I have written an application using Python 2.7 and Tkinter that edits *.docx files. In the Text control where the user is able to write text, I can change the font family and fontsize with tag_add and tag_config. Now I need to write this to new *.docx file. How can I retrieve fontfamily and fontsize that were set in several of the text ranges?
My best guess is to get tag from range and later try to get font from this, but I’m not sure.
I have just solved my problem myself 🙂
Maybe anyone will need it somewhen. You can read any applied attribute from a tag. To do this, you have to use
tag_cgetmethod:Now, when we got the font from specially tag, we can get from it other attributes by the same way:
It works! 😉