private short readShort(RandomAccessFileOrArray stream) throws IOException { if (isBigEndian) { return stream.readShort(); } else { return stream.readShortLE(); } }
private void readRangeRecord(List<Integer> glyphIds) throws IOException { int startGlyphId = rf.readShort(); int endGlyphId = rf.readShort(); int startCoverageIndex = rf.readShort(); for (int glyphId = startGlyphId; glyphId <= endGlyphId; glyphId++) { glyphIds.add(glyphId); } // LOG.debug("^^^^^^^^^Coverage Format 2.... " // + "startGlyphId=" + startGlyphId // + ", endGlyphId=" + endGlyphId // + ", startCoverageIndex=" + startCoverageIndex // + "\n, glyphIds" + glyphIds); }
private void readAnchorTable(int anchorTableLocation) throws IOException { rf.seek(anchorTableLocation); int anchorFormat = rf.readShort(); if (anchorFormat != 1) { System.err.println("The extra features of the AnchorFormat " + anchorFormat + " will not be used"); } int x = rf.readShort(); int y = rf.readShort(); }
private short readShort(RandomAccessFileOrArray stream) throws IOException { if (isBigEndian) { return stream.readShort(); } else { return stream.readShortLE(); } }
private void readAnchorTable(int anchorTableLocation) throws IOException { rf.seek(anchorTableLocation); int anchorFormat = rf.readShort(); if (anchorFormat != 1) { System.err.println("The extra features of the AnchorFormat " + anchorFormat + " will not be used"); } int x = rf.readShort(); int y = rf.readShort(); }
private void readScriptRecord(final int scriptListTableLocationOffset, Map<String, Integer> scriptRecords) throws IOException { String scriptTag = rf.readString(4, "utf-8"); int scriptOffset = rf.readShort(); scriptRecords.put(scriptTag, scriptListTableLocationOffset + scriptOffset); }
short getShort() { try { return buf.readShort(); } catch (Exception e) { throw new ExceptionConverter(e); } }
short getShort() { try { return buf.readShort(); } catch (Exception e) { throw new ExceptionConverter(e); } }
private void readScriptRecord(final int scriptListTableLocationOffset, Map<String, Integer> scriptRecords) throws IOException { String scriptTag = rf.readString(4, "utf-8"); int scriptOffset = rf.readShort(); scriptRecords.put(scriptTag, scriptListTableLocationOffset + scriptOffset); }
private void readLangSysRecord(Map<String, Integer> langSysRecords) throws IOException { String langSysTag = rf.readString(4, "utf-8"); int langSys = rf.readShort(); langSysRecords.put(langSysTag, langSys); }
private void readFeatureTable(final int featureTableLocationOffset) throws IOException { rf.seek(featureTableLocationOffset); int featureParamsOffset = rf.readShort(); LOG.debug("featureParamsOffset=" + featureParamsOffset); int lookupCount = rf.readShort(); LOG.debug("lookupCount=" + lookupCount); List<Short> lookupListIndices = new ArrayList<Short>(lookupCount); for (int i = 0; i < lookupCount; i++) { lookupListIndices.add(rf.readShort()); } // LOG.debug("lookupListIndices=" + lookupListIndices); }
private void readLangSysRecord(Map<String, Integer> langSysRecords) throws IOException { String langSysTag = rf.readString(4, "utf-8"); int langSys = rf.readShort(); langSysRecords.put(langSysTag, langSys); }
private void readLigatureSetTable(int ligatureSetTableLocation, int coverageGlyphId) throws IOException { rf.seek(ligatureSetTableLocation); int ligatureCount = rf.readShort(); LOG.debug("ligatureCount=" + ligatureCount); List<Integer> ligatureOffsets = new ArrayList<Integer>(ligatureCount); for (int i = 0; i < ligatureCount; i++) { int ligatureOffset = rf.readShort(); ligatureOffsets.add(ligatureOffset); } for (int ligatureOffset : ligatureOffsets) { readLigatureTable(ligatureSetTableLocation + ligatureOffset, coverageGlyphId); } }
private void readLigatureSetTable(int ligatureSetTableLocation, int coverageGlyphId) throws IOException { rf.seek(ligatureSetTableLocation); int ligatureCount = rf.readShort(); LOG.debug("ligatureCount=" + ligatureCount); List<Integer> ligatureOffsets = new ArrayList<Integer>(ligatureCount); for (int i = 0; i < ligatureCount; i++) { int ligatureOffset = rf.readShort(); ligatureOffsets.add(ligatureOffset); } for (int ligatureOffset : ligatureOffsets) { readLigatureTable(ligatureSetTableLocation + ligatureOffset, coverageGlyphId); } }
private void readMarkArrayTable(int markArrayLocation) throws IOException { rf.seek(markArrayLocation); int markCount = rf.readShort(); List<MarkRecord> markRecords = new ArrayList<GlyphPositioningTableReader.MarkRecord>(); for (int i = 0; i < markCount; i++) { markRecords.add(readMarkRecord()); } for (MarkRecord markRecord : markRecords) { readAnchorTable(markArrayLocation + markRecord.markAnchorOffset); } }
private void readMarkArrayTable(int markArrayLocation) throws IOException { rf.seek(markArrayLocation); int markCount = rf.readShort(); List<MarkRecord> markRecords = new ArrayList<GlyphPositioningTableReader.MarkRecord>(); for (int i = 0; i < markCount; i++) { markRecords.add(readMarkRecord()); } for (MarkRecord markRecord : markRecords) { readAnchorTable(markArrayLocation + markRecord.markAnchorOffset); } }
private void readLookUpType_8(int lookupTableLocation) throws IOException { rf.seek(lookupTableLocation); int posFormat = rf.readShort(); if (posFormat == 3) { LOG.debug("Reading `Look Up Type 8, Format 3` ...."); readChainingContextPositioningFormat_3(lookupTableLocation); } else { System.err.println("The posFormat " + posFormat + " for `Look Up Type 8` is not supported by " + GlyphPositioningTableReader.class.getSimpleName()); } }
private void readLookUpType_8(int lookupTableLocation) throws IOException { rf.seek(lookupTableLocation); int posFormat = rf.readShort(); if (posFormat == 3) { LOG.debug("Reading `Look Up Type 8, Format 3` ...."); readChainingContextPositioningFormat_3(lookupTableLocation); } else { System.err.println("The posFormat " + posFormat + " for `Look Up Type 8` is not supported by " + GlyphPositioningTableReader.class.getSimpleName()); } }