use of org.openxmlformats.schemas.drawingml.x2006.main.CTTextFont in project poi by apache.
the class XSSFTextRun method setFontFamily.
public void setFontFamily(String typeface, byte charset, byte pictAndFamily, boolean isSymbol) {
CTTextCharacterProperties rPr = getRPr();
if (typeface == null) {
if (rPr.isSetLatin())
rPr.unsetLatin();
if (rPr.isSetCs())
rPr.unsetCs();
if (rPr.isSetSym())
rPr.unsetSym();
} else {
if (isSymbol) {
CTTextFont font = rPr.isSetSym() ? rPr.getSym() : rPr.addNewSym();
font.setTypeface(typeface);
} else {
CTTextFont latin = rPr.isSetLatin() ? rPr.getLatin() : rPr.addNewLatin();
latin.setTypeface(typeface);
if (charset != -1)
latin.setCharset(charset);
if (pictAndFamily != -1)
latin.setPitchFamily(pictAndFamily);
}
}
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTTextFont in project poi by apache.
the class XSSFTextRun method getFontFamily.
/**
* @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;
}
Aggregations