3 /* written 2011 by Werner Lemberg <wl@gnu.org> */
11 #include FT_FREETYPE_H
12 #include FT_TRUETYPE_TABLES_H
13 #include FT_TRUETYPE_TAGS_H
15 #include "ttfautohint.h"
18 /* these macros convert 16bit and 32bit numbers into single bytes */
19 /* using the byte order needed within SFNT files */
21 #define HIGH(x) (FT_Byte)(((x) & 0xFF00) >> 8)
22 #define LOW(x) ((x) & 0x00FF)
24 #define BYTE1(x) (FT_Byte)(((x) & 0xFF000000UL) >> 24);
25 #define BYTE2(x) (FT_Byte)(((x) & 0x00FF0000UL) >> 16);
26 #define BYTE3(x) (FT_Byte)(((x) & 0x0000FF00UL) >> 8);
27 #define BYTE4(x) ((x) & 0x000000FFUL);
30 /* the length of a dummy `DSIG' table */
33 /* an empty slot in the table info array */
34 #define MISSING (FT_ULong)~0
36 /* the offset to the loca table format in the `head' table */
37 #define LOCA_FORMAT_OFFSET 51
39 /* various offsets within the `maxp' table */
40 #define MAXP_MAX_ZONES_OFFSET 14
41 #define MAXP_MAX_TWILIGHT_POINTS_OFFSET 16
42 #define MAXP_MAX_STORAGE_OFFSET 18
43 #define MAXP_MAX_FUNCTION_DEFS_OFFSET 20
44 #define MAXP_MAX_INSTRUCTION_DEFS_OFFSET 22
45 #define MAXP_MAX_STACK_ELEMENTS_OFFSET 24
46 #define MAXP_MAX_INSTRUCTIONS_OFFSET 26
51 /* flags in composite glyph records */
52 #define ARGS_ARE_WORDS 0x0001
53 #define ARGS_ARE_XY_VALUES 0x0002
54 #define WE_HAVE_A_SCALE 0x0008
55 #define MORE_COMPONENTS 0x0020
56 #define WE_HAVE_AN_XY_SCALE 0x0040
57 #define WE_HAVE_A_2X2 0x0080
58 #define WE_HAVE_INSTR 0x0100
60 /* flags in simple glyph records */
61 #define X_SHORT_VECTOR 0x02
62 #define Y_SHORT_VECTOR 0x04
75 /* a representation of the data in the `glyf' table */
76 typedef struct glyf_Data_
83 typedef struct SFNT_Table_
{
86 FT_Byte
* buf
; /* the table data */
87 FT_ULong offset
; /* from beginning of file */
89 void* data
; /* used e.g. for `glyf' table data */
93 /* we use indices into the SFNT table array to */
94 /* represent table info records of the TTF header */
95 typedef FT_ULong SFNT_Table_Info
;
97 /* this structure is used to model a TTF or a subfont within a TTC */
98 typedef struct SFNT_
{
101 SFNT_Table_Info
* table_infos
;
102 FT_ULong num_table_infos
;
104 /* various SFNT table indices */
111 /* our font object */
112 typedef struct FONT_
{
128 #endif /* __TA_H__ */