/** * Gets the font family for the specified font char range. * If fcr is null, the font char range "ascii" is used * * @param fcr the font char range, defaults to "ansi" * @return a string representing the font famil */ public String getFontFamily(FontCharRange fcr) { CTRPr pr = getRunProperties(false); if (pr == null || !pr.isSetRFonts()) { return null; } CTFonts fonts = pr.getRFonts(); switch (fcr == null ? FontCharRange.ascii : fcr) { default: case ascii: return fonts.getAscii(); case cs: return fonts.getCs(); case eastAsia: return fonts.getEastAsia(); case hAnsi: return fonts.getHAnsi(); } }
CTRPr cellRPr = cellR.getCTR().isSetRPr() ? cellR.getCTR().getRPr() : cellR.getCTR().addNewRPr(); CTFonts cellFonts = cellRPr.isSetRFonts() ? cellRPr.getRFonts() : cellRPr.addNewRFonts(); cellFonts.setAscii(tmpFonts.getAscii()); cellFonts.setAsciiTheme(tmpFonts.getAsciiTheme()); cellFonts.setCs(tmpFonts.getCs());
@Override protected String getFamily( CTFonts fonts ) { return fonts.getAscii(); }
@Override protected String getFamily( CTFonts fonts ) { return fonts.getAscii(); }
@Override protected String getFamily( CTFonts fonts ) { return fonts.getAscii(); }
@Override protected String getFamily( CTFonts fonts ) { return fonts.getAscii(); }
/** * Specifies the fonts which shall be used to display the text contents of * this run. Specifies a font which shall be used to format all characters * in the ASCII range (0 - 127) within the parent run * * @return a string representing the font family */ public String getFontFamily() { CTRPr pr = run.getRPr(); return (pr != null && pr.isSetRFonts()) ? pr.getRFonts().getAscii() : null; }
/** * Gets the font family for the specified font char range. * If fcr is null, the font char range "ascii" is used * * @param fcr the font char range, defaults to "ansi" * @return a string representing the font famil */ public String getFontFamily(FontCharRange fcr) { CTRPr pr = getRunProperties(false); if (pr == null || !pr.isSetRFonts()) { return null; } CTFonts fonts = pr.getRFonts(); switch (fcr == null ? FontCharRange.ascii : fcr) { default: case ascii: return fonts.getAscii(); case cs: return fonts.getCs(); case eastAsia: return fonts.getEastAsia(); case hAnsi: return fonts.getHAnsi(); } }
String fontFamily = fonts.getAscii(); if ( StringUtils.isNotEmpty( fontFamily ) )