/** 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 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]; }
/** Print a pretty string */ @Override public String toString () { String indent = " "; return indent + " format: " + getFormat () + " length: " + getLength () + " language: " + getLanguage () + "\n"; } }
/** * Determine whether args 1 and 2 are words or bytes */ public boolean argsAreWords(int index) { return ((getFlag(index) & ARG_1_AND_2_ARE_WORDS) != 0); }
/** * Compare two records */ public boolean equals(Object o) { return (compareTo(o) == 0); }
/** Creates a new instance of HeadTable * Makes up reasonable(?) defaults for all values */ protected HheaTable() { super(TrueTypeTable.HEAD_TABLE); setVersion(0x10000); }
/** * Get the length of this table */ public int getLength() { if (isLongFormat()) { return offsets.length * 4; } else { return offsets.length * 2; } } }
/** * Cannot map from a byte */ public byte map(byte src) { char c = map((char) src); if (c < Byte.MIN_VALUE || c > Byte.MAX_VALUE) { // out of range return 0; } return (byte) c; }
/** Creates a new instance of PostTable */ protected PostTable() { super (TrueTypeTable.POST_TABLE); nameMap = new PostMap(); }
/** * Map a character name to a glyphNameIndex */ public short getGlyphNameIndex(String name) { return nameMap.getCharIndex(name); }
/** * Determine whether the x value for the given point is byte or short. * If true, it is a byte, if false it is a short */ protected boolean yIsByte(int pointIndex) { return ((getFlag(pointIndex) & 0x4) != 0); }
/** 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 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]; }
/** * Determine whether to round XY values to the grid */ public boolean roundXYToGrid(int index) { return ((getFlag(index) & ROUND_XY_TO_GRID) != 0); }
/** 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 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]; }
/** * Use the metrics of this component for the compound */ public boolean useMetrics(int index) { return ((getFlag(index) & USE_MY_METRICS) != 0); }