private void addNameTag(String tag) throws IOException { String name = fontDescriptor.getFontName(); String newName = tag + name; dict.setName(COSName.BASE_FONT, newName); fontDescriptor.setFontName(newName); cidFont.setName(COSName.BASE_FONT, newName); }
/** * 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; }
fd.setFontName(ttf.getName());
private void addNameTag(String tag) throws IOException { String name = fontDescriptor.getFontName(); String newName = tag + name; dict.setName(COSName.BASE_FONT, newName); fontDescriptor.setFontName(newName); cidFont.setName(COSName.BASE_FONT, newName); }
private void addNameTag(String tag) throws IOException { String name = fontDescriptor.getFontName(); String newName = tag + name; dict.setName(COSName.BASE_FONT, newName); fontDescriptor.setFontName(newName); cidFont.setName(COSName.BASE_FONT, newName); }
/** * 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; }
fd.setFontName(ttf.getName());
fd.setFontName(ttf.getName());