private void initDescriptions() { for (GlyfCompositeComp component : components) { try { int index = component.getGlyphIndex(); GlyphData glyph = glyphTable.getGlyph(index); if (glyph != null) { descriptions.put(index, glyph.getDescription()); } } catch (IOException e) { LOG.error(e); } } } }
long offset = getOffset(); if (glyphs == null) glyphs[gid] = getGlyphData(gid);
break; case GlyphTable.TAG: table = new GlyphTable(font); break; case HeaderTable.TAG:
table = new GlyphTable(font);
@Override public GeneralPath getPath(int code) throws IOException { int gid = codeToGID(code); GlyphData glyph = ttf.getGlyph().getGlyph(gid); // some glyphs have no outlines (e.g. space, table, newline) if (glyph == null) { return new GeneralPath(); } else { return glyph.getPath(); } }
data.seek(getOffset() + offsets[gid]); GlyphData glyph = getGlyphData(gid);
try is.skip(g.getOffset()); long lastOff = 0L; for (Integer glyphId : glyphIds)
break; case GlyphTable.TAG: table = new GlyphTable(font); break; case HeaderTable.TAG:
@Override public GeneralPath getPath(String name) throws IOException { int gid = nameToGID(name); // some glyphs have no outlines (e.g. space, table, newline) GlyphData glyph = getGlyph().getGlyph(gid); if (glyph == null) { return new GeneralPath(); } else { // must scaled by caller using FontMatrix return glyph.getPath(); } }
long offset = getOffset(); if (glyphs == null) glyphs[gid] = getGlyphData(gid);
try is.skip(g.getOffset()); long lastOff = 0L; for (Integer glyphId : glyphIds)
GlyphData glyph = ttf.getGlyph().getGlyph(gid); if (glyph != null)
long offset = getOffset(); if (glyphs == null) glyphs[gid] = getGlyphData(gid);
try is.skip(g.getOffset());
@Override public float getHeight(int code) throws IOException { int gid = codeToGID(code); GlyphData glyph = ttf.getGlyph().getGlyph(gid); if (glyph != null) { return glyph.getBoundingBox().getHeight(); } return 0; }
data.seek(getOffset() + offsets[gid]); GlyphData glyph = getGlyphData(gid);
try (InputStream is = ttf.getOriginalData()) is.skip(g.getOffset());
@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(); } }