@Override public long getCurrentPosition() throws IOException { return stream.getCurrentPosition(); }
/** * Read the given table if necessary. Package-private, used by TTFParser only. * * @param table the table to be initialized * * @throws IOException if there was an error reading the table. */ void readTable(TTFTable table) throws IOException { // PDFBOX-4219: synchronize on data because it is accessed by several threads // when PDFBox is accessing a standard 14 font for the first time synchronized (data) { // save current position long currentPosition = data.getCurrentPosition(); data.seek(table.getOffset()); table.read(this, data); // restore current position data.seek(currentPosition); } }
/** * Returns the raw bytes of the given table. * @param table the table to read. * @throws IOException if there was an error accessing the table. */ public byte[] getTableBytes(TTFTable table) throws IOException { synchronized (lockReadtable) { // save current position long currentPosition = data.getCurrentPosition(); data.seek(table.getOffset()); // read all data byte[] bytes = data.read((int) table.getLength()); // restore current position data.seek(currentPosition); return bytes; } }
int[] startCount = data.readUnsignedShortArray(segCount); int[] idDelta = data.readUnsignedShortArray(segCount); long idRangeOffsetPosition = data.getCurrentPosition(); int[] idRangeOffset = data.readUnsignedShortArray(segCount);
subHeaders[i] = new SubHeader(firstCode, entryCount, idDelta, idRangeOffset); long startGlyphIndexOffset = data.getCurrentPosition(); glyphIdToCharacterCode = newGlyphIdToCharacterCode(numGlyphs); characterCodeToGlyphId = new HashMap<>(numGlyphs);
long currentPosition = data.getCurrentPosition();
@Override public long getCurrentPosition() throws IOException { return stream.getCurrentPosition(); }
@Override public long getCurrentPosition() throws IOException { return stream.getCurrentPosition(); }
@Override @SuppressWarnings({"squid:S1854"}) void read(TrueTypeFont ttf, TTFDataStream data) throws IOException { long start = data.getCurrentPosition(); @SuppressWarnings({"unused"}) int majorVersion = data.readUnsignedShort(); int minorVersion = data.readUnsignedShort(); int scriptListOffset = data.readUnsignedShort(); int featureListOffset = data.readUnsignedShort(); int lookupListOffset = data.readUnsignedShort(); @SuppressWarnings({"unused"}) long featureVariationsOffset = -1L; if (minorVersion == 1L) { featureVariationsOffset = data.readUnsignedInt(); } scriptList = readScriptList(data, start + scriptListOffset); featureListTable = readFeatureList(data, start + featureListOffset); lookupListTable = readLookupList(data, start + lookupListOffset); GlyphSubstitutionDataExtractor glyphSubstitutionDataExtractor = new GlyphSubstitutionDataExtractor(); gsubData = glyphSubstitutionDataExtractor .getGsubData(scriptList, featureListTable, lookupListTable); }
/** * Read the given table if necessary. Package-private, used by TTFParser only. * * @param table the table to be initialized * * @throws IOException if there was an error reading the table. */ void readTable(TTFTable table) throws IOException { // save current position long currentPosition = data.getCurrentPosition(); data.seek(table.getOffset()); table.read(this, data); // restore current position data.seek(currentPosition); }
/** * Read the given table if necessary. Package-private, used by TTFParser only. * * @param table the table to be initialized * * @throws IOException if there was an error reading the table. */ void readTable(TTFTable table) throws IOException { // PDFBOX-4219: synchronize on data because it is accessed by several threads // when PDFBox is accessing a standard 14 font for the first time synchronized (data) { // save current position long currentPosition = data.getCurrentPosition(); data.seek(table.getOffset()); table.read(this, data); // restore current position data.seek(currentPosition); } }
/** * Returns the raw bytes of the given table. * @param table the table to read. * @throws IOException if there was an error accessing the table. */ public synchronized byte[] getTableBytes(TTFTable table) throws IOException { // save current position long currentPosition = data.getCurrentPosition(); data.seek(table.getOffset()); // read all data byte[] bytes = data.read((int)table.getLength()); // restore current position data.seek(currentPosition); return bytes; }
/** * Returns the raw bytes of the given table. * @param table the table to read. * @throws IOException if there was an error accessing the table. */ public byte[] getTableBytes(TTFTable table) throws IOException { synchronized (lockReadtable) { // save current position long currentPosition = data.getCurrentPosition(); data.seek(table.getOffset()); // read all data byte[] bytes = data.read((int) table.getLength()); // restore current position data.seek(currentPosition); return bytes; } }
int[] startCount = data.readUnsignedShortArray(segCount); int[] idDelta = data.readUnsignedShortArray(segCount); long idRangeOffsetPosition = data.getCurrentPosition(); int[] idRangeOffset = data.readUnsignedShortArray(segCount);
int[] startCount = data.readUnsignedShortArray(segCount); int[] idDelta = data.readUnsignedShortArray(segCount); long idRangeOffsetPosition = data.getCurrentPosition(); int[] idRangeOffset = data.readUnsignedShortArray(segCount);
subHeaders[i] = new SubHeader(firstCode, entryCount, idDelta, idRangeOffset); long startGlyphIndexOffset = data.getCurrentPosition(); glyphIdToCharacterCode = newGlyphIdToCharacterCode(numGlyphs); characterCodeToGlyphId = new HashMap<>(numGlyphs);
subHeaders[i] = new SubHeader(firstCode, entryCount, idDelta, idRangeOffset); long startGlyphIndexOffset = data.getCurrentPosition(); glyphIdToCharacterCode = newGlyphIdToCharacterCode(numGlyphs); characterCodeToGlyphId = new HashMap<Integer, Integer>(numGlyphs);
long currentPosition = data.getCurrentPosition();
long currentPosition = data.getCurrentPosition();
@Override void read(TrueTypeFont ttf, TTFDataStream data) throws IOException { long start = data.getCurrentPosition(); @SuppressWarnings("unused") int majorVersion = data.readUnsignedShort(); int minorVersion = data.readUnsignedShort(); int scriptListOffset = data.readUnsignedShort(); int featureListOffset = data.readUnsignedShort(); int lookupListOffset = data.readUnsignedShort(); @SuppressWarnings("unused") long featureVariationsOffset = -1L; if (minorVersion == 1L) { featureVariationsOffset = data.readUnsignedInt(); } scriptList = readScriptList(data, start + scriptListOffset); featureList = readFeatureList(data, start + featureListOffset); lookupList = readLookupList(data, start + lookupListOffset); }