/** * Initialize the CMapEntry when it is a subtype 0. * * @param data the data stream of the to be parsed ttf font * @throws IOException If there is an error parsing the true type font. */ protected void processSubtype0(TTFDataStream data) throws IOException { byte[] glyphMapping = data.read(256); glyphIdToCharacterCode = newGlyphIdToCharacterCode(256); characterCodeToGlyphId = new HashMap<>(glyphMapping.length); for (int i = 0; i < glyphMapping.length; i++) { int glyphIndex = glyphMapping[i] & 0xFF; glyphIdToCharacterCode[glyphIndex] = i; characterCodeToGlyphId.put(i, glyphIndex); } }
private void buildGlyphIdToCharacterCodeLookup(int maxGlyphId) { glyphIdToCharacterCode = newGlyphIdToCharacterCode(maxGlyphId + 1); for (Entry<Integer, Integer> entry : characterCodeToGlyphId.entrySet()) { if (glyphIdToCharacterCode[entry.getValue()] == -1) { // add new value to the array glyphIdToCharacterCode[entry.getValue()] = entry.getKey(); } else { // there is already a mapping for the given glyphId List<Integer> mappedValues = glyphIdToCharacterCodeMultiple.get(entry.getValue()); if (mappedValues == null) { mappedValues = new ArrayList<>(); glyphIdToCharacterCodeMultiple.put(entry.getValue(), mappedValues); mappedValues.add(glyphIdToCharacterCode[entry.getValue()]); // mark value as multiple mapping glyphIdToCharacterCode[entry.getValue()] = Integer.MIN_VALUE; } mappedValues.add(entry.getKey()); } } }
glyphIdToCharacterCode = newGlyphIdToCharacterCode(numGlyphs); characterCodeToGlyphId = new HashMap<>(numGlyphs); for (long i = 0; i < nbGroups; ++i)
glyphIdToCharacterCode = newGlyphIdToCharacterCode(numGlyphs); characterCodeToGlyphId = new HashMap<>(numGlyphs);
glyphIdToCharacterCode = newGlyphIdToCharacterCode(numGlyphs); characterCodeToGlyphId = new HashMap<>(numGlyphs); for (int i = 0; i <= maxSubHeaderIndex; ++i)
/** * Initialize the CMapEntry when it is a subtype 0. * * @param data the data stream of the to be parsed ttf font * @throws IOException If there is an error parsing the true type font. */ protected void processSubtype0(TTFDataStream data) throws IOException { byte[] glyphMapping = data.read(256); glyphIdToCharacterCode = newGlyphIdToCharacterCode(256); characterCodeToGlyphId = new HashMap<Integer, Integer>(glyphMapping.length); for (int i = 0; i < glyphMapping.length; i++) { int glyphIndex = glyphMapping[i] & 0xFF; glyphIdToCharacterCode[glyphIndex] = i; characterCodeToGlyphId.put(i, glyphIndex); } }
/** * Initialize the CMapEntry when it is a subtype 0. * * @param data the data stream of the to be parsed ttf font * @throws IOException If there is an error parsing the true type font. */ protected void processSubtype0(TTFDataStream data) throws IOException { byte[] glyphMapping = data.read(256); glyphIdToCharacterCode = newGlyphIdToCharacterCode(256); characterCodeToGlyphId = new HashMap<>(glyphMapping.length); for (int i = 0; i < glyphMapping.length; i++) { int glyphIndex = glyphMapping[i] & 0xFF; glyphIdToCharacterCode[glyphIndex] = i; characterCodeToGlyphId.put(i, glyphIndex); } }
private void buildGlyphIdToCharacterCodeLookup(int maxGlyphId) { glyphIdToCharacterCode = newGlyphIdToCharacterCode(maxGlyphId + 1); for (Entry<Integer, Integer> entry : characterCodeToGlyphId.entrySet()) { if (glyphIdToCharacterCode[entry.getValue()] == -1) { // add new value to the array glyphIdToCharacterCode[entry.getValue()] = entry.getKey(); } else { // there is already a mapping for the given glyphId List<Integer> mappedValues = glyphIdToCharacterCodeMultiple.get(entry.getValue()); if (mappedValues == null) { mappedValues = new ArrayList<>(); glyphIdToCharacterCodeMultiple.put(entry.getValue(), mappedValues); mappedValues.add(glyphIdToCharacterCode[entry.getValue()]); // mark value as multiple mapping glyphIdToCharacterCode[entry.getValue()] = Integer.MIN_VALUE; } mappedValues.add(entry.getKey()); } } }
private void buildGlyphIdToCharacterCodeLookup(int maxGlyphId) { glyphIdToCharacterCode = newGlyphIdToCharacterCode(maxGlyphId + 1); for (Entry<Integer, Integer> entry : characterCodeToGlyphId.entrySet()) { if (glyphIdToCharacterCode[entry.getValue()] == -1) { // add new value to the array glyphIdToCharacterCode[entry.getValue()] = entry.getKey(); } else { // there is already a mapping for the given glyphId List<Integer> mappedValues = glyphIdToCharacterCodeMultiple.get(entry.getValue()); if (mappedValues == null) { mappedValues = new ArrayList<Integer>(); glyphIdToCharacterCodeMultiple.put(entry.getValue(), mappedValues); mappedValues.add(glyphIdToCharacterCode[entry.getValue()]); // mark value as multiple mapping glyphIdToCharacterCode[entry.getValue()] = Integer.MIN_VALUE; } mappedValues.add(entry.getKey()); } } }
glyphIdToCharacterCode = newGlyphIdToCharacterCode(numGlyphs); characterCodeToGlyphId = new HashMap<>(numGlyphs); for (long i = 0; i < nbGroups; ++i)
glyphIdToCharacterCode = newGlyphIdToCharacterCode(numGlyphs); characterCodeToGlyphId = new HashMap<Integer, Integer>(numGlyphs); for (long i = 0; i < nbGroups; ++i)
glyphIdToCharacterCode = newGlyphIdToCharacterCode(numGlyphs); characterCodeToGlyphId = new HashMap<>(numGlyphs);
glyphIdToCharacterCode = newGlyphIdToCharacterCode(numGlyphs); characterCodeToGlyphId = new HashMap<Integer, Integer>(numGlyphs);
glyphIdToCharacterCode = newGlyphIdToCharacterCode(numGlyphs); characterCodeToGlyphId = new HashMap<>(numGlyphs); for (int i = 0; i <= maxSubHeaderIndex; ++i)
glyphIdToCharacterCode = newGlyphIdToCharacterCode(numGlyphs); characterCodeToGlyphId = new HashMap<Integer, Integer>(numGlyphs); for (int i = 0; i <= maxSubHeaderIndex; ++i)