@Override public GeneralPath getPath(int code) throws IOException { if (ttf instanceof OpenTypeFont && ((OpenTypeFont)ttf).isPostScript()) { // we're not supposed to have CFF fonts inside PDCIDFontType2, but if we do, // then we treat their CIDs as GIDs, see PDFBOX-3344 int cid = codeToGID(code); Type2CharString charstring = ((OpenTypeFont)ttf).getCFF().getFont().getType2CharString(cid); return charstring.getPath(); } else { int gid = codeToGID(code); GlyphData glyph = ttf.getGlyph().getGlyph(gid); if (glyph != null) { return glyph.getPath(); } return new GeneralPath(); } }
@Override OpenTypeFont newFont(TTFDataStream raf) { return new OpenTypeFont(raf); }
/** * Get the "CFF" table for this OTF. * * @return The "CFF" table. */ public CFFTable getCFF() throws IOException { if (!isPostScript) { throw new UnsupportedOperationException("TTF fonts do not have a CFF table"); } return (CFFTable) getTable(CFFTable.TAG); }
ttfFont = otf; if (otf.isPostScript()) if (otf.hasLayoutTables())
if (mapping.isCIDFont()) cffFont = mapping.getFont().getCFF().getFont(); if (cffFont instanceof CFFCIDFont)
ttfFont = otf; if (otf.isPostScript()) if (otf.hasLayoutTables())
if (mapping.isCIDFont()) cffFont = mapping.getFont().getCFF().getFont(); if (cffFont instanceof CFFCIDFont)
if (ttf instanceof OpenTypeFont && ((OpenTypeFont)ttf).isPostScript()) CFFFont cff = ((OpenTypeFont)ttf).getCFF().getFont(); CIDSystemInfo ros = null; if (cff instanceof CFFCIDFont)
ttfFont = otf; if (otf.isPostScript()) if (otf.hasLayoutTables())
if (mapping.isCIDFont()) cffFont = mapping.getFont().getCFF().getFont(); if (cffFont instanceof CFFCIDFont)
@Override OpenTypeFont newFont(TTFDataStream raf) { return new OpenTypeFont(raf); }
/** * Get the "CFF" table for this OTF. * * @return The "CFF" table. */ public CFFTable getCFF() throws IOException { if (!isPostScript) { throw new UnsupportedOperationException("TTF fonts do not have a CFF table"); } return (CFFTable) getTable(CFFTable.TAG); }
@Override public GeneralPath getPath(int code) throws IOException { if (ttf instanceof OpenTypeFont && ((OpenTypeFont)ttf).isPostScript()) { // we're not supposed to have CFF fonts inside PDCIDFontType2, but if we do, // then we treat their CIDs as GIDs, see PDFBOX-3344 int cid = codeToGID(code); Type2CharString charstring = ((OpenTypeFont)ttf).getCFF().getFont().getType2CharString(cid); return charstring.getPath(); } else { int gid = codeToGID(code); GlyphData glyph = ttf.getGlyph().getGlyph(gid); if (glyph != null) { return glyph.getPath(); } return new GeneralPath(); } }
@Override OpenTypeFont newFont(TTFDataStream raf) { return new OpenTypeFont(raf); }
/** * Get the "CFF" table for this OTF. * * @return The "CFF" table. */ public CFFTable getCFF() throws IOException { if (!isPostScript) { throw new UnsupportedOperationException("TTF fonts do not have a CFF table"); } return (CFFTable) getTable(CFFTable.TAG); }
@Override public GeneralPath getPath(int code) throws IOException { if (ttf instanceof OpenTypeFont && ((OpenTypeFont)ttf).isPostScript()) { // we're not supposed to have CFF fonts inside PDCIDFontType2, but if we do, // then we treat their CIDs as GIDs, see PDFBOX-3344 int cid = codeToGID(code); Type2CharString charstring = ((OpenTypeFont)ttf).getCFF().getFont().getType2CharString(cid); return charstring.getPath(); } else { int gid = codeToGID(code); GlyphData glyph = ttf.getGlyph().getGlyph(gid); if (glyph != null) { return glyph.getPath(); } return new GeneralPath(); } }
if (ttf instanceof OpenTypeFont && ((OpenTypeFont)ttf).isPostScript()) CFFFont cff = ((OpenTypeFont)ttf).getCFF().getFont(); CIDSystemInfo ros = null; if (cff instanceof CFFCIDFont)