Uint16 flagsClearTypeOptimized : 1 // Bit 13: Font optimized for ClearType. Uint16 flagsFontConverted : 1 // Bit 12: Font converted (produce compatible metrics) Uint16 flagsLosslessCompression : 1 // Bit 11: Font data is 'lossless,' as a result of having been compressed and decompressed with the Agfa MicroType Express engine. However, they are not implemented in OpenType. Uint16 flagsAppleReserved : 6 // Bits 5-10: These should be set according to Apple's specification. Uint16 flagsInstructionsAlterAdvanceWidth : 1 // Bit 4: Instructions may alter advance width (the advance widths might not scale linearly) Uint16 flagsForceIntegerPpemValues : 1 // Bit 3: Force ppem to integer values for all internal scaler math may use fractional ppem sizes if this bit is clear Uint16 flagsInstructionsDependOnPointSize : 1 // Bit 2: Instructions may depend on point size Uint16 flagsLeftSideBearingAtX0 : 1 // Bit 1: Left sidebearing point at x=0 Uint16 flagsBaselineAtY0 : 1 // Bit 0: Baseline for font at y=0 Uint32 checkSumAdjustment // To compute: set it to 0, sum the entire font as ULONG, then store 0xB1B0AFBA - sum. Struct TableRecordPass0(OpenTypeFont& font)įont.hheaTable_numberOfMetrics = table.numberOfMetrics įont.headTable_indexToLocFormat = table.indexToLocFormat įont.vheaTable_numberOfMetrics = table.numberOfMetrics įont.maxpTable_numberOfGlyphs = table.numberOfGlyphs įixed16_16 version // 0x00010000 for version 1.0.įixed16_16 fontRevision // Set by font manufacturer. For the sake of pre-parsing any tables for which other String ReadTableRecord( struct TableRecord &s ) Uint8 data // Point raw table data too (whether recognized or not) VmtxTable table(font.maxpTable_numberOfGlyphs, font.vheaTable_numberOfMetrics) SbixTable table(font.maxpTable_numberOfGlyphs) LocaTable table(font.maxpTable_numberOfGlyphs, font.headTable_indexToLocFormat) HmtxTable table(font.maxpTable_numberOfGlyphs, font.hheaTable_numberOfMetrics) HdmxTable table(font.maxpTable_numberOfGlyphs) GlyfTable table(font.maxpTable_numberOfGlyphs, font.locaTable) Uint32 length // Length of this table in bytes. Uint32 checkSum // CheckSum for this table. Local int64 originalFilePosition = FTell() Switch based on specific type of table. Uint32 offset // Offset from beginning of TrueType font file. Uint32 dsigOffset // The offset (in bytes) of the DSIG table from the beginning of the TTC file (null if no signature) Uint32 dsigLength // The length (in bytes) of the DSIG table (null if no signature) Uint32 dsigTag // Tag indicating that a DSIG table exists, 0x44534947 ('DSIG') (null if no signature) OpenTypeFontCollectionRecord offsetTable // Array of offsets to the OffsetTable for each font from the beginning of the file Uint32 numberOfFonts // Number of fonts in TTC FSeek(FileSize()) // (span whole file, which doesn't hold true for TTC's)Ĭhar8 tag // TrueType Collection ID string: 'ttcf'įixed16_16 version // Version of the TTC Header (1.0), 0x00010000 Parse actual tables now that we have all the needed info. LocaTable locaTable(font.maxpTable_numberOfGlyphs, font.headTable_indexToLocFormat) Preparse the loca table for the benefit of the glyf table later. Uint16 searchRange // (Maximum power of 2 Typedef EbdtTable CbdtTable // Color embedded bitmap data Typedef EblcTable CblcTable // Color embedded bitmap locator Struct VdmxTable // Vertical device metrics Struct SvgTable // Scalable vector graphics Struct PrepTable // Control value program for transforms Struct PcltTable // Printer Control Language Table Struct LocaTable // Glyph locator offsets Struct HdmxTable // Horizontal device metrics Struct GaspTable // Grid-fitting And Scan-conversion Procedure Struct FvarTable // Font variations table Struct EbscTable // Embedded bitmap scaling Struct EblcTable // Embedded bitmap locator Void fixed2_14Write(fixed2_14& f, string s) Void fixed16_16Write(fixed16_16& f, string s) 1.1 A.M.: Added an Exit if an incorrect value is found for formatting in the ExtensionSubstFormat1 subtable from template can also parse TrueType fonts (TTF). Purpose: Displays hierarchy of an OpenType font. Authors: Dwayne Robinson and Alex McDonnell of Cisco Systems
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |