Fix OTS warning about `maxp.maxSizeOfInstructions`.
[ttfautohint.git] / lib / ttfautohint-errors.h
blobaf5424e66dcc2a43898f5685579b051f9687ceb2
1 /* ttfautohint-errors.h */
3 /*
4 * Copyright (C) 2011-2022 by Werner Lemberg.
6 * This file is part of the ttfautohint library, and may only be used,
7 * modified, and distributed under the terms given in `COPYING'. By
8 * continuing to use, modify, or distribute this file you indicate that you
9 * have read `COPYING' and understand and accept it fully.
11 * The file `COPYING' mentioned in the previous paragraph is distributed
12 * with the ttfautohint library.
16 #ifndef TTFAUTOHINT_ERRORS_H_
17 #define TTFAUTOHINT_ERRORS_H_
19 /* We duplicate FreeType's error handling macros for simplicity; */
20 /* however, we don't use module-specific error codes. */
22 #undef TA_ERR_XCAT
23 #undef TA_ERR_CAT
24 #define TA_ERR_XCAT(x, y) x ## y
25 #define TA_ERR_CAT(x, y) TA_ERR_XCAT(x, y)
27 #undef TA_ERR_PREFIX
28 #define TA_ERR_PREFIX TA_Err_
30 #ifndef TA_ERRORDEF
31 # define TA_ERRORDEF(e, v, s) e = v,
32 # define TA_ERROR_START_LIST enum {
33 # define TA_ERROR_END_LIST TA_ERR_CAT(TA_ERR_PREFIX, Max) };
34 #endif
36 #define TA_ERRORDEF_(e, v, s) \
37 TA_ERRORDEF(TA_ERR_CAT(TA_ERR_PREFIX, e), v, s)
38 #define TA_NOERRORDEF_ TA_ERRORDEF_
41 /* The error codes. */
43 #ifdef TA_ERROR_START_LIST
44 TA_ERROR_START_LIST
45 #endif
47 TA_NOERRORDEF_(Ok, 0x00,
48 "no error")
50 TA_ERRORDEF_(Invalid_FreeType_Version, 0x0E,
51 "invalid FreeType version (need 2.4.5 or higher)")
52 TA_ERRORDEF_(Missing_Legal_Permission, 0x0F,
53 "legal permission bit in `OS/2' font table is set")
54 TA_ERRORDEF_(Invalid_Stream_Write, 0x5F,
55 "invalid stream write")
56 TA_ERRORDEF_(Hinter_Overflow, 0xF0,
57 "hinter overflow")
58 TA_ERRORDEF_(Missing_Glyph, 0xF1,
59 "missing standard character glyph")
60 TA_ERRORDEF_(Missing_Unicode_CMap, 0xF2,
61 "missing Unicode character map")
62 TA_ERRORDEF_(Missing_Symbol_CMap, 0xF3,
63 "missing symbol character map")
64 TA_ERRORDEF_(Canceled, 0xF4,
65 "execution canceled")
66 TA_ERRORDEF_(Already_Processed, 0xF5,
67 "font already processed by ttfautohint")
68 TA_ERRORDEF_(Invalid_Font_Type, 0xF6,
69 "not a font with TrueType outlines in SFNT format")
70 TA_ERRORDEF_(Unknown_Argument, 0xF7,
71 "unknown argument")
73 TA_ERRORDEF_(XHeightSnapping_Invalid_Character, 0x101,
74 "invalid character")
75 TA_ERRORDEF_(XHeightSnapping_Overflow, 0x102,
76 "numerical overflow")
77 TA_ERRORDEF_(XHeightSnapping_Invalid_Range, 0x103,
78 "invalid range")
79 TA_ERRORDEF_(XHeightSnapping_Overlapping_Ranges, 0x104,
80 "overlapping ranges")
81 TA_ERRORDEF_(XHeightSnapping_Not_Ascending, 0x105,
82 "not ascending ranges or values")
83 TA_ERRORDEF_(XHeightSnapping_Allocation_Error, 0x106,
84 "allocation error")
86 TA_ERRORDEF_(Control_Syntax_Error, 0x201,
87 "syntax error")
88 TA_ERRORDEF_(Control_Invalid_Font_Index, 0x202,
89 "invalid font index")
90 TA_ERRORDEF_(Control_Invalid_Glyph_Index, 0x203,
91 "invalid glyph index")
92 TA_ERRORDEF_(Control_Invalid_Glyph_Name, 0x204,
93 "invalid glyph name")
94 TA_ERRORDEF_(Control_Invalid_Character, 0x205,
95 "invalid character")
96 TA_ERRORDEF_(Control_Invalid_Style, 0x206,
97 "invalid style")
98 TA_ERRORDEF_(Control_Invalid_Script, 0x207,
99 "invalid script")
100 TA_ERRORDEF_(Control_Invalid_Feature, 0x208,
101 "invalid feature")
102 TA_ERRORDEF_(Control_Invalid_Shift, 0x209,
103 "invalid shift")
104 TA_ERRORDEF_(Control_Invalid_Offset, 0x20A,
105 "invalid offset")
106 TA_ERRORDEF_(Control_Invalid_Range, 0x20B,
107 "invalid range")
108 TA_ERRORDEF_(Control_Invalid_Glyph, 0x20C,
109 "invalid glyph")
110 TA_ERRORDEF_(Control_Overflow, 0x20D,
111 "overflow")
112 TA_ERRORDEF_(Control_Overlapping_Ranges, 0x20E,
113 "overlapping ranges")
114 TA_ERRORDEF_(Control_Ranges_Not_Ascending, 0x20F,
115 "ranges not ascending")
116 TA_ERRORDEF_(Control_Allocation_Error, 0x210,
117 "allocation error")
118 TA_ERRORDEF_(Control_Flex_Error, 0x211,
119 "internal flex error")
120 TA_ERRORDEF_(Control_Too_Much_Widths, 0x212,
121 "too much stem width values")
123 /* error codes in the range 0x300-0x3FF are related to the reference font; */
124 /* subtract 0x300 to get the normal FreeType meaning */
126 #ifdef TA_ERROR_END_LIST
127 TA_ERROR_END_LIST
128 #endif
131 #undef TA_ERROR_START_LIST
132 #undef TA_ERROR_END_LIST
133 #undef TA_ERRORDEF
134 #undef TA_ERRORDEF_
135 #undef TA_NOERRORDEF_
137 #endif /* TTFAUTOHINT_ERRORS_H_ */
139 /* end of ttfautohint-errors.h */