1 #ifndef HB_OPEN_FILE_PRIVATE_H
2 #define HB_OPEN_FILE_PRIVATE_H
4 /*Organization of an OpenType Font
5 note: structs are supposely properly aligned to avoid the use of packing*/
7 #define IDX_NOT_FOUND 0xffff
10 uint32_t tag
; /*4-byte identifier */
11 uint32_t chk_sum
; /*Check sum for this table */
12 uint32_t of
; /*Offset from beginning of TrueType font file */
13 uint32_t len
; /*Length of this table */
15 #define ot_tbl tbl_rec
18 uint32_t sfnt_ver
; /*'\0\001\0\00' if TrueType / 'OTTO' if CFF& */
19 uint16_t tbls_n
; /*Number of tables */
20 uint16_t search_range
; /*(Maximum power of 2 <= tbls_n) * 16 */
21 uint16_t entry_selector
; /*Log2(maximum power of 2 <= tbls_n) */
22 uint16_t range_shift
; /*tbls_n * 16 - search_range */
23 struct tbl_rec tbls
[1]; /*tbl_rec entries. tbls_n items. */
25 #define of_tbl ot_fnt_face
33 uint32_t ttc_tag
; /*TrueType Collection ID string: 'ttcf' */
34 struct fixed_ver ver
; /*Version of the TTC Header (1.0), 0x00010000 */
35 uint32_t of_tbls_ofs
[1]; /*Array of offsets to the OffsetTable for each */
36 /*font from the beginning of the file */
42 uint32_t ttc_tag
; /*TrueType Collection ID string: 'ttcf' */
43 struct fixed_ver ver
; /*Version of the TTC Header (1.0 or 2.0), */
44 /* 0x00010000 or 0x00020000 */
46 struct ttc_hdr_ver1 ver1
;
50 /*OpenType with Postscript outlines*/
51 #define CFF_TAG HB_TAG('O','T','T','O')
52 /*OpenType with TrueType outlines*/
53 #define TRUETYPE_TAG HB_TAG( 0 , 1 , 0 , 0 )
54 /*TrueType Collection*/
55 #define TTC_TAG HB_TAG('t','t','c','f')
56 /*Obsolete Apple TrueType*/
57 #define TRUE_TAG HB_TAG('t','r','u','e')
58 /*Obsolete Apple Type1 font in SFNT container*/
59 #define TYP1_TAG HB_TAG('t','y','p','1')
64 struct ot_fnt_face fnt_face
;
65 struct ttc_hdr ttc_hdr
;
69 struct ot_fnt_face
*ot_fnt_file_get_face(struct ot_fnt_file
*ot_fnt_file
,
72 struct tbl_rec
*ot_fnt_face_get_tbl_by_tag(struct ot_fnt_face
*ot_fnt_face
,