public String getTypeface() { if (font.isSetTypeface()) { return font.getTypeface(); } else { return null; } }
@Override public String getTypeface() { CTTextFont tf = getXmlObject(false); return (tf != null && tf.isSetTypeface()) ? tf.getTypeface() : null; }
/** * @return font family or null if not set */ public String getFontFamily(){ CTTextCharacterProperties rPr = getRPr(); CTTextFont font = rPr.getLatin(); if(font != null){ return font.getTypeface(); } return XSSFFont.DEFAULT_FONT_NAME; }
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuFont()){ setValue(props.getBuFont().getTypeface()); return true; } return false; } };
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuFont()){ setValue(props.getBuFont().getTypeface()); return true; } return false; } };
/** * @return typeface of the major font to use in a document. * Typically the major font is used for heading areas of a document. * */ @SuppressWarnings("WeakerAccess") public String getMajorFont(){ return _theme.getThemeElements().getFontScheme().getMajorFont().getLatin().getTypeface(); }
/** * @return typeface of the minor font to use in a document. * Typically the monor font is used for normal text or paragraph areas. * */ @SuppressWarnings("WeakerAccess") public String getMinorFont(){ return _theme.getThemeElements().getFontScheme().getMinorFont().getLatin().getTypeface(); } }
String typeface = font.isSetTypeface() ? font.getTypeface() : ""; if (typeface.startsWith("+mj-") || typeface.startsWith("+mn-")) { if (font == null || !font.isSetTypeface() || "".equals(font.getTypeface())) { font = coll.getLatin();
public String getTypeface() { if (font.isSetTypeface()) { return font.getTypeface(); } else { return null; } }
/** * @return font family or null if not set */ public String getFontFamily(){ CTTextCharacterProperties rPr = getRPr(); CTTextFont font = rPr.getLatin(); if(font != null){ return font.getTypeface(); } return XSSFFont.DEFAULT_FONT_NAME; }
@Override public String getTypeface() { CTTextFont tf = getXmlObject(false); return (tf != null && tf.isSetTypeface()) ? tf.getTypeface() : null; }
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuFont()){ setValue(props.getBuFont().getTypeface()); return true; } return false; } };
public boolean fetch(CTTextCharacterProperties props){ CTTextFont font = props.getLatin(); if(font != null){ String typeface = font.getTypeface(); if("+mj-lt".equals(typeface)) { typeface = theme.getMajorFont(); } else if ("+mn-lt".equals(typeface)){ typeface = theme.getMinorFont(); } setValue(typeface); return true; } return false; } };
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuFont()){ setValue(props.getBuFont().getTypeface()); return true; } return false; } };
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuFont()){ setValue(props.getBuFont().getTypeface()); return true; } return false; } };
/** * @return typeface of the major font to use in a document. * Typically the major font is used for heading areas of a document. * */ @SuppressWarnings("WeakerAccess") public String getMajorFont(){ return _theme.getThemeElements().getFontScheme().getMajorFont().getLatin().getTypeface(); }
/** * @return typeface of the minor font to use in a document. * Typically the monor font is used for normal text or paragraph areas. * */ public String getMinorFont(){ return _theme.getThemeElements().getFontScheme().getMinorFont().getLatin().getTypeface(); }
/** * @return typeface of the minor font to use in a document. * Typically the monor font is used for normal text or paragraph areas. * */ @SuppressWarnings("WeakerAccess") public String getMinorFont(){ return _theme.getThemeElements().getFontScheme().getMinorFont().getLatin().getTypeface(); } }
/** * @return typeface of the major font to use in a document. * Typically the major font is used for heading areas of a document. * */ public String getMajorFont(){ return _theme.getThemeElements().getFontScheme().getMajorFont().getLatin().getTypeface(); }
private String getFontFamily( XWPFStylesDocument stylesDocument, CTFonts fonts ) { org.openxmlformats.schemas.wordprocessingml.x2006.main.STTheme.Enum asciiTheme = getTheme( fonts ); if ( asciiTheme != null ) { try { List<ThemeDocument> themeDocuments = stylesDocument.getThemeDocuments(); if ( themeDocuments.size() > 0 ) { for ( ThemeDocument themeDocument : themeDocuments ) { CTFontCollection fontCollection = getFontCollection( themeDocument, asciiTheme ); if ( fontCollection != null && fontCollection.getLatin() != null ) { return fontCollection.getLatin().getTypeface(); } } } return getDefaultFontFamily( asciiTheme ); } catch ( Exception e ) { e.printStackTrace(); } } return getFamily(fonts); }