public void setFontSize(Double size) { if (size == null) { if (props.isSetSz()) { props.unsetSz(); } } else if (size < 1 || 400 < size) { throw new IllegalArgumentException("Minimum inclusive = 1. Maximum inclusive = 400."); } else { props.setSz((int) (100 * size)); } }
@Override public void setFontSize(Double fontSize){ CTTextCharacterProperties rPr = getRPr(true); if(fontSize == null) { if (rPr.isSetSz()) { rPr.unsetSz(); } } else { if (fontSize < 1.0) { throw new IllegalArgumentException("Minimum font size is 1pt but was " + fontSize); } rPr.setSz((int)(100*fontSize)); } }
/** * * @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){ CTTextCharacterProperties rPr = getRPr(); if(fontSize == -1.0) { if(rPr.isSetSz()) rPr.unsetSz(); } else { if(fontSize < 1.0) { throw new IllegalArgumentException("Minimum font size is 1pt but was " + fontSize); } rPr.setSz((int)(100*fontSize)); } }
CTTextCharacterProperties rPr = r.addNewRPr(); rPr.setLang("en-US"); rPr.setSz(1100); r.setT(str.getString());
CTTextCharacterProperties rPr = r.addNewRPr(); rPr.setLang("en-US"); rPr.setSz(1100); r.setT(str.getString());
public void setFontSize(Double size) { if (size == null) { if (props.isSetSz()) { props.unsetSz(); } } else if (size < 1 || 400 < size) { throw new IllegalArgumentException("Minimum inclusive = 1. Maximum inclusive = 400."); } else { props.setSz((int) (100 * size)); } }
/** * * @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){ CTTextCharacterProperties rPr = getRPr(); if(fontSize == -1.0) { if(rPr.isSetSz()) rPr.unsetSz(); } else { if(fontSize < 1.0) { throw new IllegalArgumentException("Minimum font size is 1pt but was " + fontSize); } rPr.setSz((int)(100*fontSize)); } }
/** * * @param fontSize font size in points. * The value of <code>-1</code> unsets the Sz attribyte from the underlying xml bean */ public void setFontSize(double fontSize){ CTTextCharacterProperties rPr = getRPr(); if(fontSize == -1.0) { if(rPr.isSetSz()) rPr.unsetSz(); } else { if(fontSize < 1.0) { throw new IllegalArgumentException("Minimum font size is 1pt but was " + fontSize); } rPr.setSz((int)(100*fontSize)); } }
@Override public void setFontSize(Double fontSize){ CTTextCharacterProperties rPr = getRPr(true); if(fontSize == null) { if (rPr.isSetSz()) { rPr.unsetSz(); } } else { if (fontSize < 1.0) { throw new IllegalArgumentException("Minimum font size is 1pt but was " + fontSize); } rPr.setSz((int)(100*fontSize)); } }
CTTextCharacterProperties rpr = tb1.getCTShape().getTxBody().getPArray(0).getRArray(0).getRPr(); rpr.addNewLatin().setTypeface("Trebuchet MS"); rpr.setSz(900); // 9 pt col = Color.pink; rpr.addNewSolidFill().addNewSrgbClr().setVal(new byte[]{(byte)col.getRed(),(byte)col.getGreen(),(byte)col.getBlue()});
CTTextCharacterProperties rPr = r.addNewRPr(); rPr.setLang("en-US"); rPr.setSz(1100); r.setT(str.getString());
CTTextCharacterProperties rPr = r.addNewRPr(); rPr.setLang("en-US"); rPr.setSz(1100); r.setT(str.getString());
public void setText(XSSFRichTextString str){ XSSFWorkbook wb = (XSSFWorkbook)getDrawing().getParent().getParent(); str.setStylesTableReference(wb.getStylesSource()); CTTextParagraph p = CTTextParagraph.Factory.newInstance(); if(str.numFormattingRuns() == 0){ CTRegularTextRun r = p.addNewR(); CTTextCharacterProperties rPr = r.addNewRPr(); rPr.setLang("en-US"); rPr.setSz(1100); r.setT(str.getString()); } else { for (int i = 0; i < str.getCTRst().sizeOfRArray(); i++) { CTRElt lt = str.getCTRst().getRArray(i); CTRPrElt ltPr = lt.getRPr(); if(ltPr == null) ltPr = lt.addNewRPr(); CTRegularTextRun r = p.addNewR(); CTTextCharacterProperties rPr = r.addNewRPr(); rPr.setLang("en-US"); applyAttributes(ltPr, rPr); r.setT(lt.getT()); } } ctShape.getTxBody().setPArray(new CTTextParagraph[]{p}); }
CTTextCharacterProperties endPr = p.addNewEndParaRPr(); endPr.setLang("en-US"); endPr.setSz(1100);