/** * Returns the number of glyphs (MaximumProfile.numGlyphs). * * @return the number of glyphs * @throws IOException if there was an error reading the table. */ public int getNumberOfGlyphs() throws IOException { if (numberOfGlyphs == -1) { MaximumProfileTable maximumProfile = getMaximumProfile(); if (maximumProfile != null) { numberOfGlyphs = maximumProfile.getNumGlyphs(); } else { // this should never happen numberOfGlyphs = 0; } } return numberOfGlyphs; }
@Override public boolean hasGlyph(String name) throws IOException { int gid = ttf.nameToGID(name); return !(gid == 0 || gid >= ttf.getMaximumProfile().getNumGlyphs()); }
/** * Returns the GID for the given PostScript name, if the "post" table is present. * @param name the PostScript name. */ public int nameToGID(String name) throws IOException { // look up in 'post' table readPostScriptNames(); if (postScriptNames != null) { Integer gid = postScriptNames.get(name); if (gid != null && gid > 0 && gid < getMaximumProfile().getNumGlyphs()) { return gid; } } // look up in 'cmap' int uni = parseUniName(name); if (uni > -1) { CmapLookup cmap = getUnicodeCmapLookup(false); return cmap.getGlyphId(uni); } return 0; }
for (int gid = 1, max = ttf.getMaximumProfile().getNumGlyphs(); gid <= max; gid++)
/** * Returns the number of glyphs (MaximumProfile.numGlyphs). * * @return the number of glyphs * @throws IOException if there was an error reading the table. */ public int getNumberOfGlyphs() throws IOException { if (numberOfGlyphs == -1) { MaximumProfileTable maximumProfile = getMaximumProfile(); if (maximumProfile != null) { numberOfGlyphs = maximumProfile.getNumGlyphs(); } else { // this should never happen numberOfGlyphs = 0; } } return numberOfGlyphs; }
/** * Returns the number of glyphs (MaximumProfile.numGlyphs). * * @return the number of glyphs * @throws IOException if there was an error reading the table. */ public int getNumberOfGlyphs() throws IOException { if (numberOfGlyphs == -1) { MaximumProfileTable maximumProfile = getMaximumProfile(); if (maximumProfile != null) { numberOfGlyphs = maximumProfile.getNumGlyphs(); } else { // this should never happen numberOfGlyphs = 0; } } return numberOfGlyphs; }
@Override public boolean hasGlyph(String name) throws IOException { int gid = ttf.nameToGID(name); return !(gid == 0 || gid >= ttf.getMaximumProfile().getNumGlyphs()); }
for (int gid = 1, max = ttf.getMaximumProfile().getNumGlyphs(); gid <= max; gid++)
/** * Returns the GID for the given PostScript name, if the "post" table is present. * @param name the PostScript name. */ public int nameToGID(String name) throws IOException { // look up in 'post' table readPostScriptNames(); if (postScriptNames != null) { Integer gid = postScriptNames.get(name); if (gid != null && gid > 0 && gid < getMaximumProfile().getNumGlyphs()) { return gid; } } // look up in 'cmap' int uni = parseUniName(name); if (uni > -1) { CmapSubtable cmap = getUnicodeCmap(false); return cmap.getGlyphId(uni); } return 0; }
for (int gid = 1, max = ttf.getMaximumProfile().getNumGlyphs(); gid <= max; gid++)
if (glyphPath == null) if (gid == 0 || gid >= ttf.getMaximumProfile().getNumGlyphs())
/** * Returns the GID for the given PostScript name, if the "post" table is present. * @param name the PostScript name. */ public int nameToGID(String name) throws IOException { // look up in 'post' table readPostScriptNames(); if (postScriptNames != null) { Integer gid = postScriptNames.get(name); if (gid != null && gid > 0 && gid < getMaximumProfile().getNumGlyphs()) { return gid; } } // look up in 'cmap' int uni = parseUniName(name); if (uni > -1) { CmapLookup cmap = getUnicodeCmapLookup(false); return cmap.getGlyphId(uni); } return 0; }