Visible font formatting

Hi,

I’m looking for a way to find out the “visible” font formatting of inline nodes (as they appear in Word). As far as I understood, the font formatting can be defined directly in the font properties but also with a paragraph style and a character style.

So, which formatting takes over the others?

Thank you.


Hi Calvo,


Thanks for your inquiry. Formatting is applied on a few different levels. For example, let’s consider formatting of simple text. Text in documents is represented by Run element and a Run can only be a child of a Paragraph. You can apply formatting 1) to Run nodes by using Styles e.g. a Glyph Style, 2) to the parent of those Run nodes i.e. a Paragraph node (possibly via paragraph Styles) and 3) you can also apply direct formatting to Run nodes by using Run attributes (Font). In this case the Run will inherit formatting of Paragraph Style, a Glyph Style and then direct formatting.

Best Regards,

Hi Calvo,


Thanks for your inquiry.

Just a clarification on this. As Awais explained formatting applied to text in a Microsoft Word document can come from many different sources. A useful thing to note about the Aspose.Words API is that querying direct formatting (Run.Font, Paragraph.ParagraphFormat) will normally return the “calculated” formatting value based on all direct formatting, styles and document defaults etc. Therefore using the direct formatting properties are the best way to find the visible formatting of the content.

Thanks,