Add framework to handle hinting sets.
[ttfautohint.git] / src / tabytecode.h
blobaa95de279ca2fccf435a4ab7e55f137d7269ac20
1 /* tabytecode.h */
3 /* written 2011 by Werner Lemberg <wl@gnu.org> */
5 #ifndef __TABYTECODE_H__
6 #define __TABYTECODE_H__
8 #include "ta.h"
11 #define SVTCA_y 0x00 /* set freedom and projection vectors to y axis */
12 #define SVTCA_x 0x01 /* set freedom and projection vectors to x axis */
13 #define SPVTCA_y 0x02 /* set projection vector to y axis */
14 #define SPVTCA_x 0x03 /* set projection vector to x axis */
15 #define SFVTCA_y 0x04 /* set freedom vector to y axis */
16 #define SFVTCA_x 0x05 /* set freedom vector to x axis */
17 #define SPVTL_para 0x06 /* set projection vector parallel to line */
18 #define SPVTL_perp 0x07 /* set projection vector perpendicular to line */
19 #define SFVTL_para 0x08 /* set freedom vector parallel to line */
20 #define SFVTL_perp 0x09 /* set freedom vector perpendicular to line */
21 #define SPVFS 0x0A /* set projection vector from stack */
22 #define SFVFS 0x0B /* set freedom vector from stack */
23 #define GPV 0x0C /* get projection vector */
24 #define GFV 0x0D /* get freedom vector */
25 #define SFVTPV 0x0E /* set freedom vector to projection vector */
26 #define ISECT 0x0F /* move point to intersection of lines */
28 #define SRP0 0x10 /* set reference point 0 */
29 #define SRP1 0x11 /* set reference point 1 */
30 #define SRP2 0x12 /* set reference point 2 */
31 #define SZP0 0x13 /* set zone pointer 0 */
32 #define SZP1 0x14 /* set zone pointer 1 */
33 #define SZP2 0x15 /* set zone pointer 2 */
34 #define SZPS 0x16 /* set zone pointers */
35 #define SLOOP 0x17 /* set loop counter */
36 #define RTG 0x18 /* round to grid */
37 #define RTHG 0x19 /* round to half grid */
38 #define SMD 0x1A /* set `minimum_distance' */
39 #define ELSE 0x1B /* begin of `else' clause */
40 #define JMPR 0x1C /* jump relative */
41 #define SCVTCI 0x1D /* set `control_value_cut_in' */
42 #define SSWCI 0x1E /* set `single_width_cut_in' */
43 #define SSW 0x1F /* set `single_width_value' */
45 #define DUP 0x20 /* duplicate top stack element */
46 #define POP 0x21 /* pop top stack element */
47 #define CLEAR 0x22 /* clear entire stack */
48 #define SWAP 0x23 /* swap top two elements of stack */
49 #define DEPTH 0x24 /* get depth of stack */
50 #define CINDEX 0x25 /* copy indexed element to top of stack */
51 #define MINDEX 0x26 /* move indexed element to top of stack */
52 #define ALIGNPTS 0x27 /* align points */
53 #define INS_28 0x28 /* undefined */
54 #define UTP 0x29 /* untouch point */
55 #define LOOPCALL 0x2A /* loop and call function */
56 #define CALL 0x2B /* call function */
57 #define FDEF 0x2C /* define function */
58 #define ENDF 0x2D /* end of function */
59 #define MDAP_noround 0x2E /* move direct absolute point without rounding */
60 #define MDAP_round 0x2F /* move direct absolute point with rounding */
62 #define IUP_y 0x30 /* interpolate untouched points along y axis */
63 #define IUP_x 0x31 /* interpolate untouched points along x axis */
64 #define SHP_rp2 0x32 /* shift point using rp2 */
65 #define SHP_rp1 0x33 /* shift point using rp1 */
66 #define SHC_rp2 0x34 /* shift contour using rp2 */
67 #define SHC_rp1 0x35 /* shift contour using rp1 */
68 #define SHZ_rp2 0x36 /* shift zone using rp2 */
69 #define SHZ_rp1 0x37 /* shift zone using rp1 */
70 #define SHPIX 0x38 /* shift point by pixel amount */
71 #define IP 0x39 /* interpolate point */
72 #define MSIRP_norp0 0x3A /* move stack indirect relative point, don't set rp0 */
73 #define MSIRP_rp0 0x3B /* move stack indirect relative point, set rp0 */
74 #define ALIGNRP 0x3C /* align relative point */
75 #define RTDG 0x3D /* round to double grid */
76 #define MIAP_noround 0x3E /* move indirect absolute point without rounding */
77 #define MIAP_round 0x3F /* move indirect absolute point with rounding */
79 #define NPUSHB 0x40 /* push `n' bytes */
80 #define NPUSHW 0x41 /* push `n' words */
81 #define WS 0x42 /* write to storage area */
82 #define RS 0x43 /* read from storage area */
83 #define WCVTP 0x44 /* write to CVT in pixel units */
84 #define RCVT 0x45 /* read from CVT */
85 #define GC_cur 0x46 /* get (projected) coordinate, current position */
86 #define GC_orig 0x47 /* get (projected) coordinate, original position */
87 #define SCFS 0x48 /* set coordinate from stack */
88 #define MD_cur 0x49 /* measure distance, current positions */
89 #define MD_orig 0x4A /* measure distance, original positions */
90 #define MPPEM 0x4B /* measure PPEM */
91 #define MPS 0x4C /* measure point size */
92 #define FLIPON 0x4D /* set `auto_flip' to TRUE */
93 #define FLIPOFF 0x4E /* set `auto_flip' to FALSE */
94 #define DEBUG 0x4F /* ignored */
96 #define LT 0x50 /* lower than */
97 #define LTEQ 0x51 /* lower than or equal */
98 #define GT 0x52 /* greater than */
99 #define GTEQ 0x53 /* greater than or equal */
100 #define EQ 0x54 /* equal */
101 #define NEQ 0x55 /* not equal */
102 #define ODD 0x56 /* TRUE if odd */
103 #define EVEN 0x57 /* TRUE if even */
104 #define IF 0x58 /* start of `if' clause */
105 #define EIF 0x59 /* end of `if' or `else' clause */
106 #define AND 0x5A /* logical AND */
107 #define OR 0x5B /* logical OR */
108 #define NOT 0x5C /* logical NOT */
109 #define DELTAP1 0x5D /* delta point exception 1 */
110 #define SDB 0x5E /* set `delta_base' */
111 #define SDS 0x5F /* set `delta_shift' */
113 #define ADD 0x60 /* addition */
114 #define SUB 0x61 /* subtraction */
115 #define DIV 0x62 /* division */
116 #define MUL 0x63 /* multiplication */
117 #define ABS 0x64 /* absolute value */
118 #define NEG 0x65 /* negation */
119 #define FLOOR 0x66 /* floor operation */
120 #define CEILING 0x67 /* ceiling operation */
121 #define ROUND_gray 0x68 /* round value with gray compensation */
122 #define ROUND_black 0x69 /* round value with black compensation */
123 #define ROUND_white 0x6A /* round value with white compensation */
124 #define ROUND_3 0x6B /* undefined */
125 #define NROUND_gray 0x6C /* apply gray compensation */
126 #define NROUND_black 0x6D /* apply black compensation */
127 #define NROUND_white 0x6E /* apply white compensation */
128 #define NROUND_3 0x6F /* undefined */
130 #define WCVTF 0x70 /* write to CVT in font units */
131 #define DELTAP2 0x71 /* delta point exception 2 */
132 #define DELTAP3 0x72 /* delta point exception 3 */
133 #define DELTAC1 0x73 /* delta cvt exception 1 */
134 #define DELTAC2 0x74 /* delta cvt exception 2 */
135 #define DELTAC3 0x75 /* delta cvt exception 3 */
136 #define SROUND 0x76 /* super round */
137 #define S45Round 0x77 /* super round at 45 degrees */
138 #define JROT 0x78 /* jump relative on TRUE */
139 #define JROF 0x79 /* jump relative on FALSE */
140 #define ROFF 0x7A /* turn off rounding */
141 #define INS_7B 0x7B /* undefined */
142 #define RUTG 0x7C /* round up to grid */
143 #define RDTG 0x7D /* round down to grid */
144 #define SANGW 0x7E /* ignored, obsolete */
145 #define AA 0x7F /* ignored, obsolete */
147 #define FLIPPT 0x80 /* flip point on-curve to off-curve and vice versa */
148 #define FLIPRGON 0x81 /* flip range of points to be on-curve */
149 #define FlIPRGOFF 0x82 /* flip range of points to be off-curve */
150 #define INS_83 0x83 /* undefined */
151 #define INS_84 0x84 /* undefined */
152 #define SCANCTRL 0x85 /* scan conversion control */
153 #define SDPVTL_para 0x86 /* set dual projection vector parallel to line */
154 #define SDPVTL_perp 0x87 /* set dual projection vector perpendicular to line */
155 #define GETINFO 0x88 /* get information about font scaler and current glyph */
156 #define IDEF 0x89 /* define instruction */
157 #define ROLL 0x8A /* roll top three stack elements */
158 #define MAX 0x8B /* maximum */
159 #define MIN 0x8C /* minimum */
160 #define SCANTYPE 0x8D /* set scan conversion rules */
161 #define INSTCTRL 0x8E /* set instruction control state */
162 #define INS_8F 0x8F /* undefined */
164 #define INS_90 0x90 /* undefined */
165 #define INS_91 0x91
166 #define INS_92 0x92
167 #define INS_93 0x93
168 #define INS_94 0x94
169 #define INS_95 0x95
170 #define INS_96 0x96
171 #define INS_97 0x97
172 #define INS_98 0x98
173 #define INS_99 0x99
174 #define INS_9A 0x9A
175 #define INS_9B 0x9B
176 #define INS_9C 0x9C
177 #define INS_9D 0x9D
178 #define INS_9E 0x9E
179 #define INS_9F 0x9F
181 #define INS_A0 0xA0 /* undefined */
182 #define INS_A1 0xA1
183 #define INS_A2 0xA2
184 #define INS_A3 0xA3
185 #define INS_A4 0xA4
186 #define INS_A5 0xA5
187 #define INS_A6 0xA6
188 #define INS_A7 0xA7
189 #define INS_A8 0xA8
190 #define INS_9A 0x9A
191 #define INS_AA 0xAA
192 #define INS_AB 0xAB
193 #define INS_AC 0xAC
194 #define INS_AD 0xAD
195 #define INS_AE 0xAE
196 #define INS_AF 0xAF
198 #define PUSHB_1 0xB0 /* push 1 byte */
199 #define PUSHB_2 0xB1 /* push 2 bytes */
200 #define PUSHB_3 0xB2 /* push 3 bytes */
201 #define PUSHB_4 0xB3 /* push 4 bytes */
202 #define PUSHB_5 0xB4 /* push 5 bytes */
203 #define PUSHB_6 0xB5 /* push 6 bytes */
204 #define PUSHB_7 0xB6 /* push 7 bytes */
205 #define PUSHB_8 0xB7 /* push 8 bytes */
206 #define PUSHW_1 0xB8 /* push 1 word */
207 #define PUSHW_2 0xB9 /* push 2 words */
208 #define PUSHW_3 0xBA /* push 3 words */
209 #define PUSHW_4 0xBB /* push 4 words */
210 #define PUSHW_5 0xBC /* push 5 words */
211 #define PUSHW_6 0xBD /* push 6 words */
212 #define PUSHW_7 0xBE /* push 7 words */
213 #define PUSHW_8 0xBF /* push 8 words */
215 #define MDRP_norp0_nokeep_noround_gray 0xC0 /* move direct relative point */
216 #define MDRP_norp0_nokeep_noround_black 0xC1
217 #define MDRP_norp0_nokeep_noround_white 0xC2
218 #define MDRP_norp0_nokeep_noround_3 0xC3 /* undefined */
219 #define MDRP_norp0_nokeep_round_gray 0xC4
220 #define MDRP_norp0_nokeep_round_black 0xC5
221 #define MDRP_norp0_nokeep_round_white 0xC6
222 #define MDRP_norp0_nokeep_round_3 0xC7
223 #define MDRP_norp0_keep_noround_gray 0xC8
224 #define MDRP_norp0_keep_noround_black 0xC9
225 #define MDRP_norp0_keep_noround_white 0xCA
226 #define MDRP_norp0_keep_noround_3 0xCB
227 #define MDRP_norp0_keep_round_gray 0xCC
228 #define MDRP_norp0_keep_round_black 0xCD
229 #define MDRP_norp0_keep_round_white 0xCE
230 #define MDRP_norp0_keep_round_3 0xCF
232 #define MDRP_rp0_nokeep_noround_gray 0xD0
233 #define MDRP_rp0_nokeep_noround_black 0xD1
234 #define MDRP_rp0_nokeep_noround_white 0xD2
235 #define MDRP_rp0_nokeep_noround_3 0xD3
236 #define MDRP_rp0_nokeep_round_gray 0xD4
237 #define MDRP_rp0_nokeep_round_black 0xD5
238 #define MDRP_rp0_nokeep_round_white 0xD6
239 #define MDRP_rp0_nokeep_round_3 0xD7
240 #define MDRP_rp0_keep_noround_gray 0xD8
241 #define MDRP_rp0_keep_noround_black 0xD9
242 #define MDRP_rp0_keep_noround_white 0xDA
243 #define MDRP_rp0_keep_noround_3 0xDB
244 #define MDRP_rp0_keep_round_gray 0xDC
245 #define MDRP_rp0_keep_round_black 0xDD
246 #define MDRP_rp0_keep_round_white 0xDE
247 #define MDRP_rp0_keep_round_3 0xDF
249 #define MIRP_norp0_nokeep_noround_gray 0xE0 /* move indirect relative point */
250 #define MIRP_norp0_nokeep_noround_black 0xE1
251 #define MIRP_norp0_nokeep_noround_white 0xE2
252 #define MIRP_norp0_nokeep_noround_3 0xE3 /* undefined */
253 #define MIRP_norp0_nokeep_round_gray 0xE4
254 #define MIRP_norp0_nokeep_round_black 0xE5
255 #define MIRP_norp0_nokeep_round_white 0xE6
256 #define MIRP_norp0_nokeep_round_3 0xE7
257 #define MIRP_norp0_keep_noround_gray 0xE8
258 #define MIRP_norp0_keep_noround_black 0xE9
259 #define MIRP_norp0_keep_noround_white 0xEA
260 #define MIRP_norp0_keep_noround_3 0xEB
261 #define MIRP_norp0_keep_round_gray 0xEC
262 #define MIRP_norp0_keep_round_black 0xED
263 #define MIRP_norp0_keep_round_white 0xEE
264 #define MIRP_norp0_keep_round_3 0xEF
266 #define MIRP_rp0_nokeep_noround_gray 0xF0
267 #define MIRP_rp0_nokeep_noround_black 0xF1
268 #define MIRP_rp0_nokeep_noround_white 0xF2
269 #define MIRP_rp0_nokeep_noround_3 0xF3
270 #define MIRP_rp0_nokeep_round_gray 0xF4
271 #define MIRP_rp0_nokeep_round_black 0xF5
272 #define MIRP_rp0_nokeep_round_white 0xF6
273 #define MIRP_rp0_nokeep_round_3 0xF7
274 #define MIRP_rp0_keep_noround_gray 0xF8
275 #define MIRP_rp0_keep_noround_black 0xF9
276 #define MIRP_rp0_keep_noround_white 0xFA
277 #define MIRP_rp0_keep_noround_3 0xFB
278 #define MIRP_rp0_keep_round_gray 0xFC
279 #define MIRP_rp0_keep_round_black 0xFD
280 #define MIRP_rp0_keep_round_white 0xFE
281 #define MIRP_rp0_keep_round_3 0xFF
284 /* the value of this macro must be increased */
285 /* if a new bytecode function gets added */
286 #define NUM_FDEFS 5
289 FT_Error
290 TA_sfnt_build_cvt_table(SFNT* sfnt,
291 FONT* font);
293 FT_Error
294 TA_sfnt_build_fpgm_table(SFNT* sfnt,
295 FONT* font);
297 FT_Error
298 TA_sfnt_build_prep_table(SFNT* sfnt,
299 FONT* font);
301 FT_Error
302 TA_sfnt_build_glyf_hints(SFNT* sfnt,
303 FONT* font);
305 #endif /* __TABYTECODE_H__ */
307 /* end of tabytecode.h */