| java.lang.Object de.intarsys.font.truetype.TTFontParser
TTFontParser | public class TTFontParser (Code) | | Apple TT specification
http://developer.apple.com/fonts/TTRefMan/RM06/Chap6.html
|
TTFontParser | public TTFontParser()(Code) | | |
parseTable_head | public TTFontHeader parseTable_head(TTTable data) throws IOException(Code) | | This table gives global information about the font.
Type Name Description
FIXED Table version number 0x00010000 for version 1.0.
FIXED fontRevision Set by font manufacturer.
ULONG checkSumAdjustment To compute: set it to 0, sum the entire font as ULONG, then store 0xB1B0AFBA - sum.
ULONG magicNumber Set to 0x5F0F3CF5.
USHORT flags Bit 0 - baseline for font at y=0;
Bit 1 - left sidebearing at x=0;
Bit 2 - instructions may depend on point size;
Bit 3 - force ppem to integer values for all internal scaler math; may use fractional ppem sizes if this bit is clear;
Bit 4 - instructions may alter advance width (the advance widths might not scale linearly);
Note: All other bits must be zero.
USHORT unitsPerEm Valid range is from 16 to 16384
longDateTime created International date (8-byte field).
longDateTime modified International date (8-byte field).
FWORD xMin For all glyph bounding boxes.
FWORD yMin For all glyph bounding boxes.
FWORD xMax For all glyph bounding boxes.
FWORD yMax For all glyph bounding boxes.
USHORT macStyle Bit 0 bold (if set to 1); Bit 1 italic (if set to 1)Bits 2-15 reserved (set to 0).
USHORT lowestRecPPEM Smallest readable size in pixels.
SHORT fontDirectionHint 0 Fully mixed directional glyphs; 1 Only strongly left to right; 2 Like 1 but also contains neutrals ;-1 Only strongly right to left;-2 Like -1 but also contains neutrals.
SHORT indexToLocFormat 0 for short offsets, 1 for long.
SHORT glyphDataFormat 0 for current format.
Parameters: data - docme docme throws: IOException - docme |
parseTable_hhea | public TTHorizontalHeader parseTable_hhea(TTTable data) throws IOException(Code) | |
FIXED Table version number 0x00010000 for version 1.0.
FWORD Ascender Typographic ascent.
FWORD Descender Typographic descent.
FWORD LineGap Typographic line gap. Negative LineGap values are treated as zero in Windows 3.1, System 6, and System 7.
UFWORD advanceWidthMax Maximum advance width value in ‘hmtx’ table.
FWORD minLeftSideBearing Minimum left sidebearing value in ‘hmtx’ table.
FWORD minRightSideBearing Minimum right sidebearing value; calculated as Min(aw - lsb - (xMax - xMin)).
FWORD xMaxExtent Max(lsb + (xMax - xMin)).
SHORT caretSlopeRise Used to calculate the slope of the cursor (rise/run); 1 for vertical.
SHORT caretSlopeRun 0 for vertical.
SHORT (reserved) set to 0
SHORT (reserved) set to 0
SHORT (reserved) set to 0
SHORT (reserved) set to 0
SHORT (reserved) set to 0
SHORT metricDataFormat 0 for current format.
USHORT numberOfHMetrics Number of hMetric entries in ‘hmtx’ table; may be smaller than the total number of glyphs in the font.
Parameters: data - docme docme throws: IOException - docme |
parseTable_hmtx | public int[] parseTable_hmtx(TTTable data, int count) throws IOException(Code) | |
The type longHorMetric is defined as an array where each element has
two parts: the advance width, which is of type USHORT, and the left side
bearing, which is of type SHORT. These fields are in font design units.
typedef struct _longHorMetric {
USHORT advanceWidth;
SHORT lsb;
} longHorMetric;
Field Type Description
hMetrics longHorMetric [numberOfHMetrics] Paired advance width and
left side bearing values for each glyph. The value
numOfHMetrics comes from the 'hhea' table. If the font is
monospaced, only one entry need be in the array, but that
entry is required. The last entry applies to all subsequent
glyphs.
leftSideBearing SHORT[ ] Here the advanceWidth is assumed to be the
same as the advanceWidth for the last entry above. The
number of entries in this array is derived from numGlyphs
(from 'maxp' table) minus numberOfHMetrics. This generally
is used with a run of monospaced glyphs (e.g., Kanji fonts
or Courier fonts). Only one run is allowed and it must be
at the end. This allows a monospaced font to vary the left
side bearing values for each glyph.
Parameters: data - docme Parameters: count - docme docme throws: IOException - docme |
parseTable_os2 | public TTMetrics parseTable_os2(TTTable data) throws IOException(Code) | |
USHORT version 0x0001
SHORT xAvgCharWidth;
USHORT usWeightClass;
USHORT usWidthClass;
SHORT fsType;
SHORT ySubscriptXSize;
SHORT ySubscriptYSize;
SHORT ySubscriptXOffset;
SHORT ySubscriptYOffset;
SHORT ySuperscriptXSize;
SHORT ySuperscriptYSize;
SHORT ySuperscriptXOffset;
SHORT ySuperscriptYOffset;
SHORT yStrikeoutSize;
SHORT yStrikeoutPosition;
SHORT sFamilyClass;
PANOSE panose;
ULONG ulUnicodeRange1 Bits 0–31
ULONG ulUnicodeRange2 Bits 32–63
ULONG ulUnicodeRange3 Bits 64–95
ULONG ulUnicodeRange4 Bits 96–127
CHAR achVendID[4];
USHORT fsSelection;
USHORT usFirstCharIndex
USHORT usLastCharIndex
USHORT sTypoAscender
USHORT sTypoDescender
USHORT sTypoLineGap
USHORT usWinAscent
USHORT usWinDescent
ULONG ulCodePageRange1 Bits 0-31
ULONG ulCodePageRange2 Bits 32-63
SHORT sxHeight
SHORT sCapHeight
USHORT usDefaultChar
USHORT usBreakChar
USHORT usMaxContext
Parameters: data - docme docme throws: IOException - docme |
parseTable_post | public TTPostScriptInformation parseTable_post(TTTable data) throws IOException(Code) | |
Type Name Description
Fixed Version 0x00010000 for version 1.0
0x00020000 for version 2.0
0x00025000 for version 2.5 (deprecated)
0x00030000 for version 3.0
Fixed italicAngle Italic angle in counter-clockwise degrees from the vertical. Zero for upright text, negative for text that leans to the right (forward).
FWord underlinePosition This is the suggested distance of the top of the underline from the baseline (negative values indicate below baseline).
The PostScript definition of this FontInfo dictionary key (the y coordinate of the center of the stroke) is not used for historical reasons. The value of the PostScript key may be calculated by subtracting half the underlineThickness from the value of this field.
FWord underlineThickness Suggested values for the underline thickness.
ULONG isFixedPitch Set to 0 if the font is proportionally spaced, non-zero if the font is not proportionally spaced (i.e. monospaced).
ULONG minMemType42 Minimum memory usage when an OpenType font is downloaded.
ULONG maxMemType42 Maximum memory usage when an OpenType font is downloaded.
ULONG minMemType1 Minimum memory usage when an OpenType font is downloaded as a Type 1 font.
ULONG maxMemType1 Maximum memory usage when an OpenType font is downloaded as a Type 1 font.
Parameters: data - docme docme throws: IOException - docme |
|
|