@Override public PDFontDescriptor getFontDescriptor() { if (fontDescriptor == null) { COSDictionary fd = (COSDictionary) dict.getDictionaryObject(COSName.FONT_DESC); if (fd != null) { fontDescriptor = new PDFontDescriptor(fd); } } return fontDescriptor; }
if (fd != null) fontDescriptor = new PDFontDescriptor(fd);
@Override Object[][] getFlagBits() { PDFontDescriptor fontDesc = new PDFontDescriptor(fontDescriptor); return new Object[][]{ new Object[]{1, "FixedPitch", fontDesc.isFixedPitch()}, new Object[]{2, "Serif", fontDesc.isSerif()}, new Object[]{3, "Symbolic", fontDesc.isSymbolic()}, new Object[]{4, "Script", fontDesc.isScript()}, new Object[]{6, "NonSymbolic", fontDesc.isNonSymbolic()}, new Object[]{7, "Italic", fontDesc.isItalic()}, new Object[]{17, "AllCap", fontDesc.isAllCap()}, new Object[]{18, "SmallCap", fontDesc.isSmallCap()}, new Object[]{19, "ForceBold", fontDesc.isForceBold()} }; } }
/** * Returns a PDFontDescriptor for the given PFB. */ static PDFontDescriptor buildFontDescriptor(Type1Font type1) { boolean isSymbolic = type1.getEncoding() instanceof org.apache.fontbox.encoding.BuiltInEncoding; PDFontDescriptor fd = new PDFontDescriptor(); fd.setFontName(type1.getName()); fd.setFontFamily(type1.getFamilyName()); fd.setNonSymbolic(!isSymbolic); fd.setSymbolic(isSymbolic); fd.setFontBoundingBox(new PDRectangle(type1.getFontBBox())); fd.setItalicAngle(type1.getItalicAngle()); fd.setAscent(type1.getFontBBox().getUpperRightY()); fd.setDescent(type1.getFontBBox().getLowerLeftY()); fd.setCapHeight(type1.getBlueValues().get(2).floatValue()); fd.setStemV(0); // for PDF/A return fd; }
@Override public PDFontDescriptor getFontDescriptor() { if (fontDescriptor == null) { COSDictionary fd = (COSDictionary) dict.getDictionaryObject(COSName.FONT_DESC); if (fd != null) { fontDescriptor = new PDFontDescriptor(fd); } } return fontDescriptor; }
@Override public PDFontDescriptor getFontDescriptor() { if (fontDescriptor == null) { COSDictionary fd = (COSDictionary) dict.getDictionaryObject(COSName.FONT_DESC); if (fd != null) { fontDescriptor = new PDFontDescriptor(fd); } } return fontDescriptor; }
/** * Returns a PDFontDescriptor for the given AFM. Used only for Standard 14 fonts. * * @param metrics AFM */ static PDFontDescriptor buildFontDescriptor(FontMetrics metrics) { boolean isSymbolic = metrics.getEncodingScheme().equals("FontSpecific"); PDFontDescriptor fd = new PDFontDescriptor(); fd.setFontName(metrics.getFontName()); fd.setFontFamily(metrics.getFamilyName()); fd.setNonSymbolic(!isSymbolic); fd.setSymbolic(isSymbolic); fd.setFontBoundingBox(new PDRectangle(metrics.getFontBBox())); fd.setItalicAngle(metrics.getItalicAngle()); fd.setAscent(metrics.getAscender()); fd.setDescent(metrics.getDescender()); fd.setCapHeight(metrics.getCapHeight()); fd.setXHeight(metrics.getXHeight()); fd.setAverageWidth(metrics.getAverageCharacterWidth()); fd.setCharacterSet(metrics.getCharacterSet()); fd.setStemV(0); // for PDF/A return fd; }
PDFontDescriptor fd = new PDFontDescriptor(); fd.setFontName(ttf.getName());
if (fd != null) fontDescriptor = new PDFontDescriptor(fd);
if (fd != null) fontDescriptor = new PDFontDescriptor(fd);
/** * Returns a PDFontDescriptor for the given PFB. */ static PDFontDescriptor buildFontDescriptor(Type1Font type1) { boolean isSymbolic = type1.getEncoding() instanceof org.apache.fontbox.encoding.BuiltInEncoding; PDFontDescriptor fd = new PDFontDescriptor(); fd.setFontName(type1.getName()); fd.setFontFamily(type1.getFamilyName()); fd.setNonSymbolic(!isSymbolic); fd.setSymbolic(isSymbolic); fd.setFontBoundingBox(new PDRectangle(type1.getFontBBox())); fd.setItalicAngle(type1.getItalicAngle()); fd.setAscent(type1.getFontBBox().getUpperRightY()); fd.setDescent(type1.getFontBBox().getLowerLeftY()); fd.setCapHeight(type1.getBlueValues().get(2).floatValue()); fd.setStemV(0); // for PDF/A return fd; }
/** * Returns a PDFontDescriptor for the given PFB. */ static PDFontDescriptor buildFontDescriptor(Type1Font type1) { boolean isSymbolic = type1.getEncoding() instanceof org.apache.fontbox.encoding.BuiltInEncoding; PDFontDescriptor fd = new PDFontDescriptor(); fd.setFontName(type1.getName()); fd.setFontFamily(type1.getFamilyName()); fd.setNonSymbolic(!isSymbolic); fd.setSymbolic(isSymbolic); fd.setFontBoundingBox(new PDRectangle(type1.getFontBBox())); fd.setItalicAngle(type1.getItalicAngle()); fd.setAscent(type1.getFontBBox().getUpperRightY()); fd.setDescent(type1.getFontBBox().getLowerLeftY()); fd.setCapHeight(type1.getBlueValues().get(2).floatValue()); fd.setStemV(0); // for PDF/A return fd; }
/** * Returns a PDFontDescriptor for the given AFM. Used only for Standard 14 fonts. * * @param metrics AFM */ static PDFontDescriptor buildFontDescriptor(FontMetrics metrics) { boolean isSymbolic = metrics.getEncodingScheme().equals("FontSpecific"); PDFontDescriptor fd = new PDFontDescriptor(); fd.setFontName(metrics.getFontName()); fd.setFontFamily(metrics.getFamilyName()); fd.setNonSymbolic(!isSymbolic); fd.setSymbolic(isSymbolic); fd.setFontBoundingBox(new PDRectangle(metrics.getFontBBox())); fd.setItalicAngle(metrics.getItalicAngle()); fd.setAscent(metrics.getAscender()); fd.setDescent(metrics.getDescender()); fd.setCapHeight(metrics.getCapHeight()); fd.setXHeight(metrics.getXHeight()); fd.setAverageWidth(metrics.getAverageCharacterWidth()); fd.setCharacterSet(metrics.getCharacterSet()); fd.setStemV(0); // for PDF/A return fd; }
/** * Returns a PDFontDescriptor for the given AFM. Used only for Standard 14 fonts. * * @param metrics AFM */ static PDFontDescriptor buildFontDescriptor(FontMetrics metrics) { boolean isSymbolic = metrics.getEncodingScheme().equals("FontSpecific"); PDFontDescriptor fd = new PDFontDescriptor(); fd.setFontName(metrics.getFontName()); fd.setFontFamily(metrics.getFamilyName()); fd.setNonSymbolic(!isSymbolic); fd.setSymbolic(isSymbolic); fd.setFontBoundingBox(new PDRectangle(metrics.getFontBBox())); fd.setItalicAngle(metrics.getItalicAngle()); fd.setAscent(metrics.getAscender()); fd.setDescent(metrics.getDescender()); fd.setCapHeight(metrics.getCapHeight()); fd.setXHeight(metrics.getXHeight()); fd.setAverageWidth(metrics.getAverageCharacterWidth()); fd.setCharacterSet(metrics.getCharacterSet()); fd.setStemV(0); // for PDF/A return fd; }
PDFontDescriptor fd = new PDFontDescriptor(); fd.setFontName(ttf.getName());
PDFontDescriptor fd = new PDFontDescriptor(); fd.setFontName(ttf.getName());