Have somebody experencies with odfpy ? I parsed document with this python package and I got paragraphs with his text and stylenames, now I need to detect which type of text font is in this paragraphs text?
Do you have any ideas ?
Have somebody experencies with odfpy ? I parsed document with this python package and I got paragraphs with his text and stylenames, now I need to detect which type of text font is in this paragraphs text?
Do you have any ideas ?
Copyright © 2021 Jogjafile Inc.
The styles are defined separately from the text. The nodes that contain text will be inside nodes that have a style as an attribute. An example might look like this:
In this example, two styles (P5 or T1) might specify a font for the text. You will need to look at the document's style definition section.
This code will create a dictionary containing the document's styles.
You can then examine the relevant styles that correspond to the text you care about. Inside each style will be a style:text-properties element, and that element will have a style:font-name attribute that specifies a font.