Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Type Name Description
- uint32 scaler type A tag to indicate the OFA scaler to be used to rasterize this font; see the note on the scaler type below for more information.
- uint16 numTables number of tables
- uint16 searchRange (maximum power of 2 <= numTables)*16
- uint16 entrySelector log2(maximum power of 2 <= numTables)
- uint16 rangeShift numTables*16-searchRange
- struct Offset_Subtable;
- {
- uint32 scaler_type_;
- uint16 numTables_;
- uint16 searchRange_;
- uint16 entrySelector_;
- uint16 rangeShift_;
- bool is_for_macOS() { return scaler_type_ == 0x74727565; }
- bool is_for_windoes() { return scaler_type_ == 0x00010000; }
- bool is_truetype() { return scaler_type_ == 0x74727565 ||
- scaler_type_ == 0x00010000; }
- bool is_postscript() { return scaler_type_ == 0x74797031; }
- };
- Type Name Description
- uint32 tag 4-byte identifier
- uint32 checkSum checksum for this table
- uint32 offset offset from beginning of sfnt
- uint32 length length of this table in byte (actual length not padded length)
- struct Table_Directory_Entry
- {
- uint32 tag_;
- uint32 checkSum_;
- uint32 offset_;
- uint32 length_;
- };
- const void* p_ttf = ...;
- const Offset_Subtable* p_os = static_cast<const Offset_Subtable*>(p_ttf);
- ... use any data you're interested in...
- for (int table_num = 1; table_num <= p_os->numTables_; ++table_num)
- {
- const Table_Directory_Entry* p_tde =
- reinterpret_cast<const Table_Directory_Entry*>(&p_os[1]);
- ... use the table directory entry data ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement