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
17 #include "ttfautohint.h"
20 /* these macros convert 16bit and 32bit numbers into single bytes */
21 /* using the byte order needed within SFNT files */
23 #define HIGH(x) (FT_Byte)(((x) & 0xFF00) >> 8)
24 #define LOW(x) ((x) & 0x00FF)
26 #define BYTE1(x) (FT_Byte)(((x) & 0xFF000000UL) >> 24);
27 #define BYTE2(x) (FT_Byte)(((x) & 0x00FF0000UL) >> 16);
28 #define BYTE3(x) (FT_Byte)(((x) & 0x0000FF00UL) >> 8);
29 #define BYTE4(x) ((x) & 0x000000FFUL);
32 /* the length of a dummy `DSIG' table */
35 /* the length of our `gasp' table */
38 /* an empty slot in the table info array */
39 #define MISSING (FT_ULong)~0
41 /* the offset to the loca table format in the `head' table */
42 #define LOCA_FORMAT_OFFSET 51
44 /* various offsets within the `maxp' table */
45 #define MAXP_MAX_ZONES_OFFSET 14
46 #define MAXP_MAX_TWILIGHT_POINTS_OFFSET 16
47 #define MAXP_MAX_STORAGE_OFFSET 18
48 #define MAXP_MAX_FUNCTION_DEFS_OFFSET 20
49 #define MAXP_MAX_INSTRUCTION_DEFS_OFFSET 22
50 #define MAXP_MAX_STACK_ELEMENTS_OFFSET 24
51 #define MAXP_MAX_INSTRUCTIONS_OFFSET 26
56 /* flags in composite glyph records */
57 #define ARGS_ARE_WORDS 0x0001
58 #define ARGS_ARE_XY_VALUES 0x0002
59 #define WE_HAVE_A_SCALE 0x0008
60 #define MORE_COMPONENTS 0x0020
61 #define WE_HAVE_AN_XY_SCALE 0x0040
62 #define WE_HAVE_A_2X2 0x0080
63 #define WE_HAVE_INSTR 0x0100
65 /* flags in simple glyph records */
66 #define X_SHORT_VECTOR 0x02
67 #define Y_SHORT_VECTOR 0x04
76 FT_ULong len1
; /* number of bytes before instructions location */
77 FT_ULong len2
; /* number of bytes after instructions location; */
78 /* if zero, this indicates a composite glyph */
79 FT_Byte
* buf
; /* extracted glyph data */
80 FT_ULong flags_offset
; /* offset to last flag in a composite glyph */
82 FT_ULong ins_len
; /* number of new instructions */
83 FT_Byte
* ins_buf
; /* new instruction data */
86 /* a representation of the data in the `glyf' table */
87 typedef struct glyf_Data_
94 typedef struct SFNT_Table_
{
97 FT_Byte
* buf
; /* the table data */
98 FT_ULong offset
; /* from beginning of file */
100 void* data
; /* used e.g. for `glyf' table data */
104 /* we use indices into the SFNT table array to */
105 /* represent table info records of the TTF header */
106 typedef FT_ULong SFNT_Table_Info
;
108 /* this structure is used to model a TTF or a subfont within a TTC */
109 typedef struct SFNT_
{
112 SFNT_Table_Info
* table_infos
;
113 FT_ULong num_table_infos
;
115 /* various SFNT table indices */
122 /* our font object */
123 typedef struct FONT_
{
138 TA_LoaderRec loader
[1]; /* the interface to the autohinter */
141 #include "tatables.h"
142 #include "tabytecode.h"
144 #endif /* __TA_H__ */