/** Creates a new instance of HmtxTable */ protected GlyfTable(TrueTypeFont ttf) { super (TrueTypeTable.GLYF_TABLE); loca = (LocaTable) ttf.getTable("loca"); MaxpTable maxp = (MaxpTable) ttf.getTable("maxp"); int numGlyphs = maxp.getNumGlyphs(); glyphs = new Object[numGlyphs]; }
/** Creates a new instance of HmtxTable */ protected GlyfTable(TrueTypeFont ttf) { super (TrueTypeTable.GLYF_TABLE); loca = (LocaTable) ttf.getTable("loca"); MaxpTable maxp = (MaxpTable) ttf.getTable("maxp"); int numGlyphs = maxp.getNumGlyphs(); glyphs = new Object[numGlyphs]; }
/** Creates a new instance of HmtxTable */ protected GlyfTable(TrueTypeFont ttf) { super (TrueTypeTable.GLYF_TABLE); loca = (LocaTable) ttf.getTable("loca"); MaxpTable maxp = (MaxpTable) ttf.getTable("maxp"); int numGlyphs = maxp.getNumGlyphs(); glyphs = new Object[numGlyphs]; }
/** 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 HmtxTable(TrueTypeFont ttf) { super (TrueTypeTable.HMTX_TABLE); // the number of glyphs stored in the maxp table may be incorrect // in the case of subsetted fonts produced by some pdf generators MaxpTable maxp = (MaxpTable) ttf.getTable("maxp"); int numGlyphs = maxp.getNumGlyphs(); HheaTable hhea = (HheaTable) ttf.getTable("hhea"); int numOfLongHorMetrics = hhea.getNumOfLongHorMetrics(); advanceWidths = new short[numOfLongHorMetrics]; leftSideBearings = new short[numGlyphs]; }
/** 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 HmtxTable(TrueTypeFont ttf) { super (TrueTypeTable.HMTX_TABLE); // the number of glyphs stored in the maxp table may be incorrect // in the case of subsetted fonts produced by some pdf generators MaxpTable maxp = (MaxpTable) ttf.getTable("maxp"); int numGlyphs = maxp.getNumGlyphs(); HheaTable hhea = (HheaTable) ttf.getTable("hhea"); int numOfLongHorMetrics = hhea.getNumOfLongHorMetrics(); advanceWidths = new short[numOfLongHorMetrics]; leftSideBearings = new short[numGlyphs]; }
/** Creates a new instance of HmtxTable */ protected HmtxTable(TrueTypeFont ttf) { super (TrueTypeTable.HMTX_TABLE); // the number of glyphs stored in the maxp table may be incorrect // in the case of subsetted fonts produced by some pdf generators MaxpTable maxp = (MaxpTable) ttf.getTable("maxp"); int numGlyphs = maxp.getNumGlyphs(); HheaTable hhea = (HheaTable) ttf.getTable("hhea"); int numOfLongHorMetrics = hhea.getNumOfLongHorMetrics(); advanceWidths = new short[numOfLongHorMetrics]; leftSideBearings = new short[numGlyphs]; }
/** 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 + "NumGlyphs : " + getNumGlyphs() + "\n"); buf.append(indent + "MaxPoints : " + getMaxPoints() + "\n"); buf.append(indent + "MaxContours : " + getMaxContours() + "\n"); buf.append(indent + "MaxCompPoints : " + getMaxComponentPoints() + "\n"); buf.append(indent + "MaxCompContours : " + getMaxComponentContours() + "\n"); buf.append(indent + "MaxZones : " + getMaxZones() + "\n"); buf.append(indent + "MaxTwilightPoints: " + getMaxTwilightPoints() + "\n"); buf.append(indent + "MaxStorage : " + getMaxStorage() + "\n"); buf.append(indent + "MaxFuncDefs : " + getMaxFunctionDefs() + "\n"); buf.append(indent + "MaxInstDefs : " + getMaxInstructionDefs() + "\n"); buf.append(indent + "MaxStackElements : " + getMaxStackElements() + "\n"); buf.append(indent + "MaxSizeInst : " + getMaxSizeOfInstructions() + "\n"); buf.append(indent + "MaxCompElements : " + getMaxComponentElements() + "\n"); buf.append(indent + "MaxCompDepth : " + getMaxComponentDepth() + "\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 + "NumGlyphs : " + getNumGlyphs() + "\n"); buf.append(indent + "MaxPoints : " + getMaxPoints() + "\n"); buf.append(indent + "MaxContours : " + getMaxContours() + "\n"); buf.append(indent + "MaxCompPoints : " + getMaxComponentPoints() + "\n"); buf.append(indent + "MaxCompContours : " + getMaxComponentContours() + "\n"); buf.append(indent + "MaxZones : " + getMaxZones() + "\n"); buf.append(indent + "MaxTwilightPoints: " + getMaxTwilightPoints() + "\n"); buf.append(indent + "MaxStorage : " + getMaxStorage() + "\n"); buf.append(indent + "MaxFuncDefs : " + getMaxFunctionDefs() + "\n"); buf.append(indent + "MaxInstDefs : " + getMaxInstructionDefs() + "\n"); buf.append(indent + "MaxStackElements : " + getMaxStackElements() + "\n"); buf.append(indent + "MaxSizeInst : " + getMaxSizeOfInstructions() + "\n"); buf.append(indent + "MaxCompElements : " + getMaxComponentElements() + "\n"); buf.append(indent + "MaxCompDepth : " + getMaxComponentDepth() + "\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 + "NumGlyphs : " + getNumGlyphs() + "\n"); buf.append(indent + "MaxPoints : " + getMaxPoints() + "\n"); buf.append(indent + "MaxContours : " + getMaxContours() + "\n"); buf.append(indent + "MaxCompPoints : " + getMaxComponentPoints() + "\n"); buf.append(indent + "MaxCompContours : " + getMaxComponentContours() + "\n"); buf.append(indent + "MaxZones : " + getMaxZones() + "\n"); buf.append(indent + "MaxTwilightPoints: " + getMaxTwilightPoints() + "\n"); buf.append(indent + "MaxStorage : " + getMaxStorage() + "\n"); buf.append(indent + "MaxFuncDefs : " + getMaxFunctionDefs() + "\n"); buf.append(indent + "MaxInstDefs : " + getMaxInstructionDefs() + "\n"); buf.append(indent + "MaxStackElements : " + getMaxStackElements() + "\n"); buf.append(indent + "MaxSizeInst : " + getMaxSizeOfInstructions() + "\n"); buf.append(indent + "MaxCompElements : " + getMaxComponentElements() + "\n"); buf.append(indent + "MaxCompDepth : " + getMaxComponentDepth() + "\n"); return buf.toString(); } }
/** * Get a buffer from the data */ public ByteBuffer getData() { ByteBuffer buf = ByteBuffer.allocate(getLength()); buf.putInt(getVersion()); buf.putShort((short) getNumGlyphs()); buf.putShort((short) getMaxPoints()); buf.putShort((short) getMaxContours()); buf.putShort((short) getMaxComponentPoints()); buf.putShort((short) getMaxComponentContours()); buf.putShort((short) getMaxZones()); buf.putShort((short) getMaxTwilightPoints()); buf.putShort((short) getMaxStorage()); buf.putShort((short) getMaxFunctionDefs()); buf.putShort((short) getMaxInstructionDefs()); buf.putShort((short) getMaxStackElements()); buf.putShort((short) getMaxSizeOfInstructions()); buf.putShort((short) getMaxComponentElements()); buf.putShort((short) getMaxComponentDepth()); // reset the position to the beginning of the buffer buf.flip(); return buf; }
/** * Get a buffer from the data */ public ByteBuffer getData() { ByteBuffer buf = ByteBuffer.allocate(getLength()); buf.putInt(getVersion()); buf.putShort((short) getNumGlyphs()); buf.putShort((short) getMaxPoints()); buf.putShort((short) getMaxContours()); buf.putShort((short) getMaxComponentPoints()); buf.putShort((short) getMaxComponentContours()); buf.putShort((short) getMaxZones()); buf.putShort((short) getMaxTwilightPoints()); buf.putShort((short) getMaxStorage()); buf.putShort((short) getMaxFunctionDefs()); buf.putShort((short) getMaxInstructionDefs()); buf.putShort((short) getMaxStackElements()); buf.putShort((short) getMaxSizeOfInstructions()); buf.putShort((short) getMaxComponentElements()); buf.putShort((short) getMaxComponentDepth()); // reset the position to the beginning of the buffer buf.flip(); return buf; }
/** * Get a buffer from the data */ public ByteBuffer getData() { ByteBuffer buf = ByteBuffer.allocate(getLength()); buf.putInt(getVersion()); buf.putShort((short) getNumGlyphs()); buf.putShort((short) getMaxPoints()); buf.putShort((short) getMaxContours()); buf.putShort((short) getMaxComponentPoints()); buf.putShort((short) getMaxComponentContours()); buf.putShort((short) getMaxZones()); buf.putShort((short) getMaxTwilightPoints()); buf.putShort((short) getMaxStorage()); buf.putShort((short) getMaxFunctionDefs()); buf.putShort((short) getMaxInstructionDefs()); buf.putShort((short) getMaxStackElements()); buf.putShort((short) getMaxSizeOfInstructions()); buf.putShort((short) getMaxComponentElements()); buf.putShort((short) getMaxComponentDepth()); // reset the position to the beginning of the buffer buf.flip(); return buf; }
int nglyphs = maxp.getNumGlyphs();