@Override public FontPitch getPitch() { CTTextFont tf = getXmlObject(false); return (tf != null && tf.isSetPitchFamily()) ? FontPitch.valueOfPitchFamily(tf.getPitchFamily()) : null; }
@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 FontPitch getPitch() { CTTextFont tf = getXmlObject(false); return (tf != null && tf.isSetPitchFamily()) ? FontPitch.valueOfPitchFamily(tf.getPitchFamily()) : null; }
@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); }
/** * Creates a new instance of HSLFFontInfo and initialize it from the supplied font atom */ public HSLFFontInfo(FontEntityAtom fontAtom){ setIndex(fontAtom.getFontIndex()); setTypeface(fontAtom.getFontName()); setCharset(FontCharset.valueOf(fontAtom.getCharSet())); // assumption: the render type is exclusive switch (FLAGS_RENDER_FONTTYPE.getValue(fontAtom.getFontType())) { case 1: setRenderType(FontRenderType.raster); break; case 2: setRenderType(FontRenderType.device); break; default: case 4: setRenderType(FontRenderType.truetype); break; } byte pitchAndFamily = (byte)fontAtom.getPitchAndFamily(); setPitch(FontPitch.valueOfPitchFamily(pitchAndFamily)); setFamily(FontFamily.valueOfPitchFamily(pitchAndFamily)); setEmbedSubsetted(FLAGS_EMBED_SUBSETTED.isSet(fontAtom.getFontFlags())); setFontSubstitutable(!FLAGS_NO_FONT_SUBSTITUTION.isSet(fontAtom.getFontType())); }