private short readShort(RandomAccessFileOrArray stream) throws IOException { if (isBigEndian) { return stream.readShort(); } else { return stream.readShortLE(); } }
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 short readShort(RandomAccessFileOrArray stream) throws IOException { if (isBigEndian) { return stream.readShort(); } else { return stream.readShortLE(); } }
short getShort() { try { return buf.readShort(); } catch (Exception e) { throw new ExceptionConverter(e); } }
head.unitsPerEm = rf.readUnsignedShort(); rf.skipBytes(16); head.xMin = rf.readShort(); head.yMin = rf.readShort(); head.xMax = rf.readShort(); head.yMax = rf.readShort(); head.macStyle = rf.readUnsignedShort(); throw new DocumentException(MessageLocalization.getComposedMessage("table.1.does.not.exist.in.2", "hhea", fileName + style)); rf.seek(table_location[0] + 4); hhea.Ascender = rf.readShort(); hhea.Descender = rf.readShort(); hhea.LineGap = rf.readShort(); hhea.advanceWidthMax = rf.readUnsignedShort(); hhea.minLeftSideBearing = rf.readShort(); hhea.minRightSideBearing = rf.readShort(); hhea.xMaxExtent = rf.readShort(); hhea.caretSlopeRise = rf.readShort(); hhea.caretSlopeRun = rf.readShort(); rf.skipBytes(12); hhea.numberOfHMetrics = rf.readUnsignedShort(); rf.seek(table_location[0]); int version = rf.readUnsignedShort(); os_2.xAvgCharWidth = rf.readShort(); os_2.usWeightClass = rf.readUnsignedShort(); os_2.usWidthClass = rf.readUnsignedShort(); os_2.fsType = rf.readShort(); os_2.ySubscriptXSize = rf.readShort();
return; rf.seek(tableGlyphOffset + start); int numContours = rf.readShort(); if (numContours >= 0) return;
return; rf.seek(tableGlyphOffset + start); int numContours = rf.readShort(); if (numContours >= 0) return;
return; rf.seek(tableGlyphOffset + start); int numContours = rf.readShort(); if (numContours >= 0) return;
throw new DocumentException("Skip TT font strikeout, expect read " + want + " bytes, but only got " + got); descr.setYStrikeoutSize(rf.readShort()); descr.setYStrikeoutPosition(rf.readShort()); throw new DocumentException("Skip TT font underline, expect read " + want + " bytes, but only got " + got); descr.setUnderlinePosition(rf.readShort()); descr.setUnderlineThickness(rf.readShort());
throw new DocumentException("Skip TT font strikeout, expect read " + want + " bytes, but only got " + got); descr.setYStrikeoutSize(rf.readShort()); descr.setYStrikeoutPosition(rf.readShort()); throw new DocumentException("Skip TT font underline, expect read " + want + " bytes, but only got " + got); descr.setUnderlinePosition(rf.readShort()); descr.setUnderlineThickness(rf.readShort());
/** Reads the kerning information from the 'kern' table. * @throws IOException the font file could not be read */ void readKerning() throws IOException { int[] table_location; table_location = (int[])tables.get("kern"); if (table_location == null) return; rf.seek(table_location[0] + 2); int nTables = rf.readUnsignedShort(); int checkpoint = table_location[0] + 4; int length = 0; for (int k = 0; k < nTables; ++k) { checkpoint += length; rf.seek(checkpoint); rf.skipBytes(2); length = rf.readUnsignedShort(); int coverage = rf.readUnsignedShort(); if ((coverage & 0xfff7) == 0x0001) { int nPairs = rf.readUnsignedShort(); rf.skipBytes(6); for (int j = 0; j < nPairs; ++j) { int pair = rf.readInt(); int value = rf.readShort() * 1000 / head.unitsPerEm; kerning.put(pair, value); } } } }
/** Reads the kerning information from the 'kern' table. * @throws IOException the font file could not be read */ void readKerning() throws IOException { int table_location[]; table_location = (int[])tables.get("kern"); if (table_location == null) return; rf.seek(table_location[0] + 2); int nTables = rf.readUnsignedShort(); int checkpoint = table_location[0] + 4; int length = 0; for (int k = 0; k < nTables; ++k) { checkpoint += length; rf.seek(checkpoint); rf.skipBytes(2); length = rf.readUnsignedShort(); int coverage = rf.readUnsignedShort(); if ((coverage & 0xfff7) == 0x0001) { int nPairs = rf.readUnsignedShort(); rf.skipBytes(6); for (int j = 0; j < nPairs; ++j) { int pair = rf.readInt(); int value = rf.readShort() * 1000 / head.unitsPerEm; kerning.put(pair, value); } } } }
/** Reads the kerning information from the 'kern' table. * @throws IOException the font file could not be read */ void readKerning() throws IOException { int table_location[]; table_location = (int[])tables.get("kern"); if (table_location == null) return; rf.seek(table_location[0] + 2); int nTables = rf.readUnsignedShort(); int checkpoint = table_location[0] + 4; int length = 0; for (int k = 0; k < nTables; ++k) { checkpoint += length; rf.seek(checkpoint); rf.skipBytes(2); length = rf.readUnsignedShort(); int coverage = rf.readUnsignedShort(); if ((coverage & 0xfff7) == 0x0001) { int nPairs = rf.readUnsignedShort(); rf.skipBytes(6); for (int j = 0; j < nPairs; ++j) { int pair = rf.readInt(); int value = rf.readShort() * 1000 / head.unitsPerEm; kerning.put(pair, value); } } } }