@Override public boolean fetch(CTTextCharacterProperties props){ if (props != null && props.isSetSz()) { setValue(props.getSz()*0.01); return true; } return false; } };
@Override public Double getDefaultFontSize() { CTTextCharacterProperties endPr = _p.getEndParaRPr(); if (endPr == null || !endPr.isSetSz()) { // inherit the font size from the master style CTTextParagraphProperties masterStyle = getDefaultMasterStyle(); if (masterStyle != null) { endPr = masterStyle.getDefRPr(); } } return (endPr == null || !endPr.isSetSz()) ? 12 : (endPr.getSz() / 100.); }
/** * @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 CTTextNormalAutofit afit = getParentParagraph().getParentShape().getTxBody().getBodyPr().getNormAutofit(); if(afit != null) scale = (double)afit.getFontScale() / 100000; CTTextCharacterProperties rPr = getRPr(); if(rPr.isSetSz()){ size = rPr.getSz()*0.01; } return size * scale; }
@Override public boolean fetch(CTTextCharacterProperties props){ if (props != null && props.isSetSz()) { setValue(props.getSz()*0.01); return true; } return false; } };
public boolean fetch(CTTextCharacterProperties props){ if(props.isSetSz()){ setValue(props.getSz()*0.01); return true; } return false; } };
@Override public Double getDefaultFontSize() { CTTextCharacterProperties endPr = _p.getEndParaRPr(); if (endPr == null || !endPr.isSetSz()) { // inherit the font size from the master style CTTextParagraphProperties masterStyle = getDefaultMasterStyle(); if (masterStyle != null) { endPr = masterStyle.getDefRPr(); } } return (endPr == null || !endPr.isSetSz()) ? 12 : (endPr.getSz() / 100.); }
/** * ensure that the paragraph contains at least one character. * We need this trick to correctly measure text */ private void ensureNotEmpty(){ XSLFTextRun r = addNewTextRun(); r.setText(" "); CTTextCharacterProperties endPr = _p.getEndParaRPr(); if(endPr != null) { if(endPr.isSetSz()) r.setFontSize(endPr.getSz() / 100); } }
/** * @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 CTTextNormalAutofit afit = getParentParagraph().getParentShape().getTxBody().getBodyPr().getNormAutofit(); if(afit != null) scale = (double)afit.getFontScale() / 100000; CTTextCharacterProperties rPr = getRPr(); if(rPr.isSetSz()){ size = rPr.getSz()*0.01; } return size * scale; }