@Override public void setFamily(FontFamily family) { CTTextFont tf = getXmlObject(true); if (tf == null || (family == null && !tf.isSetPitchFamily())) { return; } FontPitch pitch = (tf.isSetPitchFamily()) ? FontPitch.valueOfPitchFamily(tf.getPitchFamily()) : FontPitch.VARIABLE; byte pitchFamily = FontPitch.getNativeId(pitch, family != null ? family : FontFamily.FF_SWISS); tf.setPitchFamily(pitchFamily); }
@Override public void setPitch(FontPitch pitch) { CTTextFont tf = getXmlObject(true); if (tf == null || (pitch == null && !tf.isSetPitchFamily())) { return; } FontFamily family = (tf.isSetPitchFamily()) ? FontFamily.valueOfPitchFamily(tf.getPitchFamily()) : FontFamily.FF_SWISS; byte pitchFamily = FontPitch.getNativeId(pitch != null ? pitch : FontPitch.VARIABLE, family); tf.setPitchFamily(pitchFamily); }
font.setPitchFamily(pitch);
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); } } }
@Override public void setPitch(FontPitch pitch) { CTTextFont tf = getXmlObject(true); if (tf == null || (pitch == null && !tf.isSetPitchFamily())) { return; } FontFamily family = (tf.isSetPitchFamily()) ? FontFamily.valueOfPitchFamily(tf.getPitchFamily()) : FontFamily.FF_SWISS; byte pitchFamily = FontPitch.getNativeId(pitch != null ? pitch : FontPitch.VARIABLE, family); tf.setPitchFamily(pitchFamily); }
@Override public void setFamily(FontFamily family) { CTTextFont tf = getXmlObject(true); if (tf == null || (family == null && !tf.isSetPitchFamily())) { return; } FontPitch pitch = (tf.isSetPitchFamily()) ? FontPitch.valueOfPitchFamily(tf.getPitchFamily()) : FontPitch.VARIABLE; byte pitchFamily = FontPitch.getNativeId(pitch, family != null ? family : FontFamily.FF_SWISS); tf.setPitchFamily(pitchFamily); }
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); } } }
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); } } }