/** * 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; }
MaximumProfileTable maxp = font.getMaximumProfile(); if (maxp == null)
for (int gid = 1, max = ttf.getMaximumProfile().getNumGlyphs(); gid <= max; gid++)
private byte[] buildMaxpTable() throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(bos); MaximumProfileTable p = ttf.getMaximumProfile(); writeFixed(out, 1.0); writeUint16(out, glyphIds.size()); writeUint16(out, p.getMaxPoints()); writeUint16(out, p.getMaxContours()); writeUint16(out, p.getMaxCompositePoints()); writeUint16(out, p.getMaxCompositeContours()); writeUint16(out, p.getMaxZones()); writeUint16(out, p.getMaxTwilightPoints()); writeUint16(out, p.getMaxStorage()); writeUint16(out, p.getMaxFunctionDefs()); writeUint16(out, p.getMaxInstructionDefs()); writeUint16(out, p.getMaxStackElements()); writeUint16(out, p.getMaxSizeOfInstructions()); writeUint16(out, p.getMaxComponentElements()); writeUint16(out, p.getMaxComponentDepth()); out.flush(); return bos.toByteArray(); }
/** * 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; }
MaximumProfileTable maxp = font.getMaximumProfile(); if (maxp == null)
MaximumProfileTable maxp = font.getMaximumProfile(); if (maxp == null)
private byte[] buildMaxpTable() throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(bos); MaximumProfileTable p = ttf.getMaximumProfile(); writeFixed(out, 1.0); writeUint16(out, glyphIds.size()); writeUint16(out, p.getMaxPoints()); writeUint16(out, p.getMaxContours()); writeUint16(out, p.getMaxCompositePoints()); writeUint16(out, p.getMaxCompositeContours()); writeUint16(out, p.getMaxZones()); writeUint16(out, p.getMaxTwilightPoints()); writeUint16(out, p.getMaxStorage()); writeUint16(out, p.getMaxFunctionDefs()); writeUint16(out, p.getMaxInstructionDefs()); writeUint16(out, p.getMaxStackElements()); writeUint16(out, p.getMaxSizeOfInstructions()); writeUint16(out, p.getMaxComponentElements()); writeUint16(out, p.getMaxComponentDepth()); out.flush(); return bos.toByteArray(); }
private byte[] buildMaxpTable() throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(bos); MaximumProfileTable p = ttf.getMaximumProfile(); writeFixed(out, 1.0); writeUint16(out, glyphIds.size()); writeUint16(out, p.getMaxPoints()); writeUint16(out, p.getMaxContours()); writeUint16(out, p.getMaxCompositePoints()); writeUint16(out, p.getMaxCompositeContours()); writeUint16(out, p.getMaxZones()); writeUint16(out, p.getMaxTwilightPoints()); writeUint16(out, p.getMaxStorage()); writeUint16(out, p.getMaxFunctionDefs()); writeUint16(out, p.getMaxInstructionDefs()); writeUint16(out, p.getMaxStackElements()); writeUint16(out, p.getMaxSizeOfInstructions()); writeUint16(out, p.getMaxComponentElements()); writeUint16(out, p.getMaxComponentDepth()); out.flush(); return bos.toByteArray(); }