/** Creates a new instance of HmtxTable */ protected LocaTable(TrueTypeFont ttf) { super (TrueTypeTable.LOCA_TABLE); MaxpTable maxp = (MaxpTable) ttf.getTable("maxp"); int numGlyphs = maxp.getNumGlyphs(); HeadTable head = (HeadTable) ttf.getTable("head"); short format = head.getIndexToLocFormat(); isLong = (format == 1); offsets = new int[numGlyphs + 1]; }
/** Creates a new instance of HmtxTable */ protected LocaTable(TrueTypeFont ttf) { super (TrueTypeTable.LOCA_TABLE); MaxpTable maxp = (MaxpTable) ttf.getTable("maxp"); int numGlyphs = maxp.getNumGlyphs(); HeadTable head = (HeadTable) ttf.getTable("head"); short format = head.getIndexToLocFormat(); isLong = (format == 1); offsets = new int[numGlyphs + 1]; }
/** * Create a pretty string */ public String toString() { StringBuffer buf = new StringBuffer(); String indent = " "; buf.append(indent + "Version : " + Integer.toHexString(getVersion()) + "\n"); buf.append(indent + "Revision : " + Integer.toHexString(getFontRevision()) + "\n"); buf.append(indent + "ChecksumAdj : " + Integer.toHexString(getChecksumAdjustment()) + "\n"); buf.append(indent + "MagicNumber : " + Integer.toHexString(getMagicNumber()) + "\n"); buf.append(indent + "Flags : " + Integer.toBinaryString(getFlags()) + "\n"); buf.append(indent + "UnitsPerEm : " + getUnitsPerEm() + "\n"); buf.append(indent + "Created : " + new Date(getCreated()) + "\n"); buf.append(indent + "Modified : " + new Date(getModified()) + "\n"); buf.append(indent + "XMin : " + getXMin() + "\n"); buf.append(indent + "XMax : " + getXMax() + "\n"); buf.append(indent + "YMin : " + getYMin() + "\n"); buf.append(indent + "YMax : " + getYMax() + "\n"); buf.append(indent + "MacStyle : " + Integer.toBinaryString(getMacStyle()) + "\n"); buf.append(indent + "LowestPPem : " + getLowestRecPPem() + "\n"); buf.append(indent + "FontDirectionHint: " + getFontDirectionHint() + "\n"); buf.append(indent + "IndexToLocFormat : " + getIndexToLocFormat() + "\n"); buf.append(indent + "GlyphDataFormat : " + getGlyphDataFormat() + "\n"); return buf.toString(); } }
/** Creates a new instance of HmtxTable */ protected LocaTable(TrueTypeFont ttf) { super (TrueTypeTable.LOCA_TABLE); MaxpTable maxp = (MaxpTable) ttf.getTable("maxp"); int numGlyphs = maxp.getNumGlyphs(); HeadTable head = (HeadTable) ttf.getTable("head"); short format = head.getIndexToLocFormat(); isLong = (format == 1); offsets = new int[numGlyphs + 1]; }
/** * Create a pretty string */ public String toString() { StringBuffer buf = new StringBuffer(); String indent = " "; buf.append(indent + "Version : " + Integer.toHexString(getVersion()) + "\n"); buf.append(indent + "Revision : " + Integer.toHexString(getFontRevision()) + "\n"); buf.append(indent + "ChecksumAdj : " + Integer.toHexString(getChecksumAdjustment()) + "\n"); buf.append(indent + "MagicNumber : " + Integer.toHexString(getMagicNumber()) + "\n"); buf.append(indent + "Flags : " + Integer.toBinaryString(getFlags()) + "\n"); buf.append(indent + "UnitsPerEm : " + getUnitsPerEm() + "\n"); buf.append(indent + "Created : " + new Date(getCreated()) + "\n"); buf.append(indent + "Modified : " + new Date(getModified()) + "\n"); buf.append(indent + "XMin : " + getXMin() + "\n"); buf.append(indent + "XMax : " + getXMax() + "\n"); buf.append(indent + "YMin : " + getYMin() + "\n"); buf.append(indent + "YMax : " + getYMax() + "\n"); buf.append(indent + "MacStyle : " + Integer.toBinaryString(getMacStyle()) + "\n"); buf.append(indent + "LowestPPem : " + getLowestRecPPem() + "\n"); buf.append(indent + "FontDirectionHint: " + getFontDirectionHint() + "\n"); buf.append(indent + "IndexToLocFormat : " + getIndexToLocFormat() + "\n"); buf.append(indent + "GlyphDataFormat : " + getGlyphDataFormat() + "\n"); return buf.toString(); } }
/** * Create a pretty string */ public String toString() { StringBuffer buf = new StringBuffer(); String indent = " "; buf.append(indent + "Version : " + Integer.toHexString(getVersion()) + "\n"); buf.append(indent + "Revision : " + Integer.toHexString(getFontRevision()) + "\n"); buf.append(indent + "ChecksumAdj : " + Integer.toHexString(getChecksumAdjustment()) + "\n"); buf.append(indent + "MagicNumber : " + Integer.toHexString(getMagicNumber()) + "\n"); buf.append(indent + "Flags : " + Integer.toBinaryString(getFlags()) + "\n"); buf.append(indent + "UnitsPerEm : " + getUnitsPerEm() + "\n"); buf.append(indent + "Created : " + new Date(getCreated()) + "\n"); buf.append(indent + "Modified : " + new Date(getModified()) + "\n"); buf.append(indent + "XMin : " + getXMin() + "\n"); buf.append(indent + "XMax : " + getXMax() + "\n"); buf.append(indent + "YMin : " + getYMin() + "\n"); buf.append(indent + "YMax : " + getYMax() + "\n"); buf.append(indent + "MacStyle : " + Integer.toBinaryString(getMacStyle()) + "\n"); buf.append(indent + "LowestPPem : " + getLowestRecPPem() + "\n"); buf.append(indent + "FontDirectionHint: " + getFontDirectionHint() + "\n"); buf.append(indent + "IndexToLocFormat : " + getIndexToLocFormat() + "\n"); buf.append(indent + "GlyphDataFormat : " + getGlyphDataFormat() + "\n"); return buf.toString(); } }
/** * Get the data we have stored */ public ByteBuffer getData() { ByteBuffer buf = ByteBuffer.allocate(getLength()); buf.putInt(getVersion()); buf.putInt(getFontRevision()); buf.putInt(getChecksumAdjustment()); buf.putInt(getMagicNumber()); buf.putShort(getFlags()); buf.putShort(getUnitsPerEm()); buf.putLong(getCreated()); buf.putLong(getModified()); buf.putShort(getXMin()); buf.putShort(getXMax()); buf.putShort(getYMin()); buf.putShort(getYMax()); buf.putShort(getMacStyle()); buf.putShort(getLowestRecPPem()); buf.putShort(getFontDirectionHint()); buf.putShort(getIndexToLocFormat()); buf.putShort(getGlyphDataFormat()); // reset the position to the start of the buffer buf.flip(); return buf; }
/** * Get the data we have stored */ public ByteBuffer getData() { ByteBuffer buf = ByteBuffer.allocate(getLength()); buf.putInt(getVersion()); buf.putInt(getFontRevision()); buf.putInt(getChecksumAdjustment()); buf.putInt(getMagicNumber()); buf.putShort(getFlags()); buf.putShort(getUnitsPerEm()); buf.putLong(getCreated()); buf.putLong(getModified()); buf.putShort(getXMin()); buf.putShort(getXMax()); buf.putShort(getYMin()); buf.putShort(getYMax()); buf.putShort(getMacStyle()); buf.putShort(getLowestRecPPem()); buf.putShort(getFontDirectionHint()); buf.putShort(getIndexToLocFormat()); buf.putShort(getGlyphDataFormat()); // reset the position to the start of the buffer buf.flip(); return buf; }
/** * Get the data we have stored */ public ByteBuffer getData() { ByteBuffer buf = ByteBuffer.allocate(getLength()); buf.putInt(getVersion()); buf.putInt(getFontRevision()); buf.putInt(getChecksumAdjustment()); buf.putInt(getMagicNumber()); buf.putShort(getFlags()); buf.putShort(getUnitsPerEm()); buf.putLong(getCreated()); buf.putLong(getModified()); buf.putShort(getXMin()); buf.putShort(getXMax()); buf.putShort(getYMin()); buf.putShort(getYMax()); buf.putShort(getMacStyle()); buf.putShort(getLowestRecPPem()); buf.putShort(getFontDirectionHint()); buf.putShort(getIndexToLocFormat()); buf.putShort(getGlyphDataFormat()); // reset the position to the start of the buffer buf.flip(); return buf; }