Debian Codegraph @

texk/web2c/mfluadir/otfcc/lib/libcff/charstring-il.h

raw
1 #ifndef CARYLL_cff_CHARSTRING_IL
2 #define CARYLL_cff_CHARSTRING_IL
3
4 #include "libcff.h"
5 #include "otfcc/table/glyf.h"
6
7 typedef enum {
8 IL_ITEM_OPERAND,
9 IL_ITEM_OPERATOR,
10 IL_ITEM_SPECIAL,
11 IL_ITEM_PHANTOM_OPERATOR,
12 IL_ITEM_PHANTOM_OPERAND
13 } cff_InstructionType;
14
15 typedef struct {
16 cff_InstructionType type;
17 arity_t arity;
18 union {
19 double d; // for type == IL_ITEM_OPERAND, IL_ITEM_PHANTOM_OPERAND
20 int32_t i; // otherwise
21 };
22 } cff_CharstringInstruction;
23
24 typedef struct {
25 uint32_t length;
26 uint32_t free;
27 cff_CharstringInstruction *instr;
28 } cff_CharstringIL;
29
30 bool instruction_eq(cff_CharstringInstruction *z1, cff_CharstringInstruction *z2);
31
32 // basic ops
33 cff_CharstringIL *cff_compileGlyphToIL(glyf_Glyph *g, uint16_t defaultWidth, uint16_t nominalWidth);
34 void cff_optimizeIL(cff_CharstringIL *il, const otfcc_Options *options);
35 cff_CharstringIL *cff_shrinkIL(cff_CharstringIL *il);
36 void cff_ILmergeIL(cff_CharstringIL *self, cff_CharstringIL *il);
37 caryll_Buffer *cff_build_IL(cff_CharstringIL *il);
38 bool cff_ilEqual(cff_CharstringIL *a, cff_CharstringIL *b);
39
40 void il_push_operand(cff_CharstringIL *il, double x);
41 void il_push_op(cff_CharstringIL *il, int32_t op);
42 void il_push_special(cff_CharstringIL *il, int32_t s);
43
44 #endif