/** * Reads a format 6 subtable. * * @param data the data stream of the to be parsed ttf font * @param numGlyphs number of glyphs to be read * @throws IOException If there is an error parsing the true type font. */ protected void processSubtype6(TTFDataStream data, int numGlyphs) throws IOException { int firstCode = data.readUnsignedShort(); int entryCount = data.readUnsignedShort(); // skip emtpy tables if (entryCount == 0) { return; } characterCodeToGlyphId = new HashMap<>(numGlyphs); int[] glyphIdArray = data.readUnsignedShortArray(entryCount); int maxGlyphId = 0; for (int i = 0; i < entryCount; i++) { maxGlyphId = Math.max(maxGlyphId, glyphIdArray[i]); characterCodeToGlyphId.put(firstCode + i, glyphIdArray[i]); } buildGlyphIdToCharacterCodeLookup(maxGlyphId); }
return; buildGlyphIdToCharacterCodeLookup(maxGlyphId);
/** * Reads a format 6 subtable. * * @param data the data stream of the to be parsed ttf font * @param numGlyphs number of glyphs to be read * @throws IOException If there is an error parsing the true type font. */ protected void processSubtype6(TTFDataStream data, int numGlyphs) throws IOException { int firstCode = data.readUnsignedShort(); int entryCount = data.readUnsignedShort(); // skip emtpy tables if (entryCount == 0) { return; } characterCodeToGlyphId = new HashMap<Integer, Integer>(numGlyphs); int[] glyphIdArray = data.readUnsignedShortArray(entryCount); int maxGlyphId = 0; for (int i = 0; i < entryCount; i++) { maxGlyphId = Math.max(maxGlyphId, glyphIdArray[i]); characterCodeToGlyphId.put(firstCode + i, glyphIdArray[i]); } buildGlyphIdToCharacterCodeLookup(maxGlyphId); }
/** * Reads a format 6 subtable. * * @param data the data stream of the to be parsed ttf font * @param numGlyphs number of glyphs to be read * @throws IOException If there is an error parsing the true type font. */ protected void processSubtype6(TTFDataStream data, int numGlyphs) throws IOException { int firstCode = data.readUnsignedShort(); int entryCount = data.readUnsignedShort(); // skip emtpy tables if (entryCount == 0) { return; } characterCodeToGlyphId = new HashMap<>(numGlyphs); int[] glyphIdArray = data.readUnsignedShortArray(entryCount); int maxGlyphId = 0; for (int i = 0; i < entryCount; i++) { maxGlyphId = Math.max(maxGlyphId, glyphIdArray[i]); characterCodeToGlyphId.put(firstCode + i, glyphIdArray[i]); } buildGlyphIdToCharacterCodeLookup(maxGlyphId); }
return; buildGlyphIdToCharacterCodeLookup(maxGlyphId);
return; buildGlyphIdToCharacterCodeLookup(maxGlyphId);