/** * @return font size in points or -1 if font size is not Set. */ public double GetFontSize() { double scale = 1; double size = XSSFFont.DEFAULT_FONT_SIZE; // default font size CT_TextNormalAutofit afit = GetParentParagraph().GetParentShape().txBody.bodyPr.normAutofit; if (afit != null) { scale = (double)afit.fontScale / 100000; } CT_TextCharacterProperties rPr = GetRPr(); if (rPr.IsSetSz()) { size = rPr.sz * 0.01; } return(size * scale); }
/** * * @param fontSize font size in points. * The value of <code>-1</code> unsets the Sz attribute from the underlying xml bean */ public void SetFontSize(double fontSize) { CT_TextCharacterProperties rPr = GetRPr(); if (fontSize == -1.0) { if (rPr.IsSetSz()) { rPr.UnsetSz(); } } else { if (fontSize < 1.0) { throw new ArgumentException("Minimum font size is 1pt but was " + fontSize); } rPr.sz = ((int)(100 * fontSize)); } }