/** 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]; }
/** * Create a pretty string */ public String toString() { StringBuffer buf = new StringBuffer(); String indent = " "; buf.append(indent + "Version : " + Integer.toHexString(getVersion()) + "\n"); buf.append(indent + "Ascent : " + getAscent() + "\n"); buf.append(indent + "Descent : " + getDescent() + "\n"); buf.append(indent + "LineGap : " + getLineGap() + "\n"); buf.append(indent + "AdvanceWidthMax : " + getAdvanceWidthMax() + "\n"); buf.append(indent + "MinLSB : " + getMinLeftSideBearing() + "\n"); buf.append(indent + "MinRSB : " + getMinRightSideBearing() + "\n"); buf.append(indent + "MaxExtent : " + getXMaxExtent() + "\n"); buf.append(indent + "CaretSlopeRise : " + getCaretSlopeRise() + "\n"); buf.append(indent + "CaretSlopeRun : " + getCaretSlopeRun() + "\n"); buf.append(indent + "CaretOffset : " + getCaretOffset() + "\n"); buf.append(indent + "MetricDataFormat : " + getMetricDataFormat() + "\n"); buf.append(indent + "NumOfLongHorMetrics : " + getNumOfLongHorMetrics() + "\n"); return buf.toString(); }
/** 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]; }
buf.putShort((short) getNumOfLongHorMetrics());
buf.putShort((short) getNumOfLongHorMetrics());
buf.putShort((short) getNumOfLongHorMetrics());
/** * Create a pretty string */ public String toString() { StringBuffer buf = new StringBuffer(); String indent = " "; buf.append(indent + "Version : " + Integer.toHexString(getVersion()) + "\n"); buf.append(indent + "Ascent : " + getAscent() + "\n"); buf.append(indent + "Descent : " + getDescent() + "\n"); buf.append(indent + "LineGap : " + getLineGap() + "\n"); buf.append(indent + "AdvanceWidthMax : " + getAdvanceWidthMax() + "\n"); buf.append(indent + "MinLSB : " + getMinLeftSideBearing() + "\n"); buf.append(indent + "MinRSB : " + getMinRightSideBearing() + "\n"); buf.append(indent + "MaxExtent : " + getXMaxExtent() + "\n"); buf.append(indent + "CaretSlopeRise : " + getCaretSlopeRise() + "\n"); buf.append(indent + "CaretSlopeRun : " + getCaretSlopeRun() + "\n"); buf.append(indent + "CaretOffset : " + getCaretOffset() + "\n"); buf.append(indent + "MetricDataFormat : " + getMetricDataFormat() + "\n"); buf.append(indent + "NumOfLongHorMetrics : " + getNumOfLongHorMetrics() + "\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 + "Ascent : " + getAscent() + "\n"); buf.append(indent + "Descent : " + getDescent() + "\n"); buf.append(indent + "LineGap : " + getLineGap() + "\n"); buf.append(indent + "AdvanceWidthMax : " + getAdvanceWidthMax() + "\n"); buf.append(indent + "MinLSB : " + getMinLeftSideBearing() + "\n"); buf.append(indent + "MinRSB : " + getMinRightSideBearing() + "\n"); buf.append(indent + "MaxExtent : " + getXMaxExtent() + "\n"); buf.append(indent + "CaretSlopeRise : " + getCaretSlopeRise() + "\n"); buf.append(indent + "CaretSlopeRun : " + getCaretSlopeRun() + "\n"); buf.append(indent + "CaretOffset : " + getCaretOffset() + "\n"); buf.append(indent + "MetricDataFormat : " + getMetricDataFormat() + "\n"); buf.append(indent + "NumOfLongHorMetrics : " + getNumOfLongHorMetrics() + "\n"); return buf.toString(); }