protected TrueTypeFontHeader(final byte[] data) throws IllegalStateException { this.version = ByteAccessUtilities.readULong(data, 0); if (version != 0x00010000 && version != 0x4F54544F) throw new IllegalStateException("Not a valid TTF or OTF file: Signature not recognized."); this.numTables = ByteAccessUtilities.readUShort(data, 4); this.searchRange = ByteAccessUtilities.readUShort(data, 6); this.entrySelector = ByteAccessUtilities.readUShort(data, 8); this.rangeShift = ByteAccessUtilities.readUShort(data, 10); }
protected TableDirectoryEntry(final byte[] data, final int offset) { this.tag = ByteAccessUtilities.readULong(data, offset); this.checkSum = ByteAccessUtilities.readULong(data, offset + 4); this.offset = (int) ByteAccessUtilities.readULong(data, offset + 8); this.length = (int) ByteAccessUtilities.readULong(data, offset + 12); }