You can look at the way the PDF or HTML output does this.
See org.docx4j.model.PropertyResolver, and in particular:
- Code: Select all
public RPr getEffectiveRPr(RPr expressRPr, PPr pPr)
Font size is one of the elements of rPr. Bear in mind that the measurement is half points, so a value of 28 means 14pt.
The essence of getting the font size is to see whether a font size is applied expressly to the run in question, and if it is not to work out what the style hierarchy applies (including default fonts).