1 /* This file has been generated by the Perl script `afblue.pl', */
2 /* using data from file `afblue.dat'. */
4 /***************************************************************************/
8 /* Auto-fitter data for blue strings (specification). */
10 /* Copyright 2013-2016 by */
11 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
13 /* This file is part of the FreeType project, and may only be used, */
14 /* modified, and distributed under the terms of the FreeType project */
15 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
16 /* this file you indicate that you have read the license and */
17 /* understand and accept it fully. */
19 /***************************************************************************/
29 /* an auxiliary macro to decode a UTF-8 character -- since we only use */
30 /* hard-coded, self-converted data, no error checking is performed */
31 #define GET_UTF8_CHAR( ch, p ) \
34 ch = (unsigned char)*p++; \
45 else if ( ch < 0xF0 ) \
56 for ( ; len_ > 0; len_-- ) \
57 ch = ( ch << 6 ) | ( *p++ & 0x3F ); \
62 /*************************************************************************/
63 /*************************************************************************/
65 /***** B L U E S T R I N G S *****/
67 /*************************************************************************/
68 /*************************************************************************/
70 /* At the bottommost level, we define strings for finding blue zones. */
73 #define AF_BLUE_STRING_MAX_LEN 51
75 /* The AF_Blue_String enumeration values are offsets into the */
76 /* `af_blue_strings' array. */
78 typedef enum AF_Blue_String_
80 AF_BLUE_STRING_ARABIC_TOP
= 0,
81 AF_BLUE_STRING_ARABIC_BOTTOM
= 18,
82 AF_BLUE_STRING_ARABIC_JOIN
= 33,
83 AF_BLUE_STRING_BENGALI_BASE
= 36,
84 AF_BLUE_STRING_BENGALI_TOP
= 68,
85 AF_BLUE_STRING_BENGALI_HEAD
= 96,
86 AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP
= 128,
87 AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM
= 152,
88 AF_BLUE_STRING_CYRILLIC_SMALL
= 176,
89 AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER
= 200,
90 AF_BLUE_STRING_DEVANAGARI_BASE
= 209,
91 AF_BLUE_STRING_DEVANAGARI_TOP
= 241,
92 AF_BLUE_STRING_DEVANAGARI_HEAD
= 273,
93 AF_BLUE_STRING_DEVANAGARI_BOTTOM
= 305,
94 AF_BLUE_STRING_GREEK_CAPITAL_TOP
= 313,
95 AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM
= 334,
96 AF_BLUE_STRING_GREEK_SMALL_BETA_TOP
= 352,
97 AF_BLUE_STRING_GREEK_SMALL
= 370,
98 AF_BLUE_STRING_GREEK_SMALL_DESCENDER
= 394,
99 AF_BLUE_STRING_HEBREW_TOP
= 418,
100 AF_BLUE_STRING_HEBREW_BOTTOM
= 442,
101 AF_BLUE_STRING_HEBREW_DESCENDER
= 460,
102 AF_BLUE_STRING_KANNADA_TOP
= 475,
103 AF_BLUE_STRING_KANNADA_BOTTOM
= 519,
104 AF_BLUE_STRING_KHMER_TOP
= 551,
105 AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP
= 575,
106 AF_BLUE_STRING_KHMER_BOTTOM
= 615,
107 AF_BLUE_STRING_KHMER_DESCENDER
= 647,
108 AF_BLUE_STRING_KHMER_LARGE_DESCENDER
= 681,
109 AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP
= 768,
110 AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM
= 776,
111 AF_BLUE_STRING_LAO_TOP
= 784,
112 AF_BLUE_STRING_LAO_BOTTOM
= 816,
113 AF_BLUE_STRING_LAO_ASCENDER
= 848,
114 AF_BLUE_STRING_LAO_LARGE_ASCENDER
= 864,
115 AF_BLUE_STRING_LAO_DESCENDER
= 876,
116 AF_BLUE_STRING_LATIN_CAPITAL_TOP
= 900,
117 AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM
= 916,
118 AF_BLUE_STRING_LATIN_SMALL_F_TOP
= 932,
119 AF_BLUE_STRING_LATIN_SMALL
= 946,
120 AF_BLUE_STRING_LATIN_SMALL_DESCENDER
= 960,
121 AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP
= 970,
122 AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM
= 990,
123 AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP
= 1010,
124 AF_BLUE_STRING_LATIN_SUBS_SMALL
= 1030,
125 AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER
= 1066,
126 AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP
= 1086,
127 AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM
= 1117,
128 AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP
= 1146,
129 AF_BLUE_STRING_LATIN_SUPS_SMALL
= 1172,
130 AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER
= 1197,
131 AF_BLUE_STRING_MYANMAR_TOP
= 1208,
132 AF_BLUE_STRING_MYANMAR_BOTTOM
= 1240,
133 AF_BLUE_STRING_MYANMAR_ASCENDER
= 1272,
134 AF_BLUE_STRING_MYANMAR_DESCENDER
= 1300,
135 AF_BLUE_STRING_TELUGU_TOP
= 1332,
136 AF_BLUE_STRING_TELUGU_BOTTOM
= 1360,
137 AF_BLUE_STRING_THAI_TOP
= 1388,
138 AF_BLUE_STRING_THAI_BOTTOM
= 1412,
139 AF_BLUE_STRING_THAI_ASCENDER
= 1440,
140 AF_BLUE_STRING_THAI_LARGE_ASCENDER
= 1452,
141 AF_BLUE_STRING_THAI_DESCENDER
= 1464,
142 AF_BLUE_STRING_THAI_LARGE_DESCENDER
= 1480,
143 AF_BLUE_STRING_THAI_DIGIT_TOP
= 1488,
145 #ifdef AF_CONFIG_OPTION_CJK
146 AF_BLUE_STRING_CJK_TOP
= af_blue_1_1
+ 1,
147 AF_BLUE_STRING_CJK_BOTTOM
= af_blue_1_1
+ 203,
148 af_blue_1_1_1
= af_blue_1_1
+ 404,
149 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
150 AF_BLUE_STRING_CJK_LEFT
= af_blue_1_1_1
+ 1,
151 AF_BLUE_STRING_CJK_RIGHT
= af_blue_1_1_1
+ 204,
152 af_blue_1_1_2
= af_blue_1_1_1
+ 405,
154 af_blue_1_1_2
= af_blue_1_1_1
+ 0,
155 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
156 af_blue_1_2
= af_blue_1_1_2
+ 0,
158 af_blue_1_2
= af_blue_1_1
+ 0,
159 #endif /* AF_CONFIG_OPTION_CJK */
162 AF_BLUE_STRING_MAX
/* do not remove */
167 FT_LOCAL_ARRAY( char )
171 /*************************************************************************/
172 /*************************************************************************/
174 /***** B L U E S T R I N G S E T S *****/
176 /*************************************************************************/
177 /*************************************************************************/
179 /* The next level is to group blue strings into style-specific sets. */
182 /* Properties are specific to a writing system. We assume that a given */
183 /* blue string can't be used in more than a single writing system, which */
185 #define AF_BLUE_PROPERTY_LATIN_TOP ( 1U << 0 ) /* must have value 1 */
186 #define AF_BLUE_PROPERTY_LATIN_SUB_TOP ( 1U << 1 )
187 #define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1U << 2 )
188 #define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1U << 3 )
189 #define AF_BLUE_PROPERTY_LATIN_LONG ( 1U << 4 )
191 #define AF_BLUE_PROPERTY_CJK_TOP ( 1U << 0 ) /* must have value 1 */
192 #define AF_BLUE_PROPERTY_CJK_HORIZ ( 1U << 1 ) /* must have value 2 */
193 #define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP
196 #define AF_BLUE_STRINGSET_MAX_LEN 8
198 /* The AF_Blue_Stringset enumeration values are offsets into the */
199 /* `af_blue_stringsets' array. */
201 typedef enum AF_Blue_Stringset_
203 AF_BLUE_STRINGSET_ARAB
= 0,
204 AF_BLUE_STRINGSET_BENG
= 4,
205 AF_BLUE_STRINGSET_CYRL
= 9,
206 AF_BLUE_STRINGSET_DEVA
= 15,
207 AF_BLUE_STRINGSET_GREK
= 21,
208 AF_BLUE_STRINGSET_HEBR
= 28,
209 AF_BLUE_STRINGSET_KNDA
= 32,
210 AF_BLUE_STRINGSET_KHMR
= 35,
211 AF_BLUE_STRINGSET_KHMS
= 41,
212 AF_BLUE_STRINGSET_LAO
= 44,
213 AF_BLUE_STRINGSET_LATN
= 50,
214 AF_BLUE_STRINGSET_LATB
= 57,
215 AF_BLUE_STRINGSET_LATP
= 64,
216 AF_BLUE_STRINGSET_MYMR
= 71,
217 AF_BLUE_STRINGSET_TELU
= 76,
218 AF_BLUE_STRINGSET_THAI
= 79,
220 #ifdef AF_CONFIG_OPTION_CJK
221 AF_BLUE_STRINGSET_HANI
= af_blue_2_1
+ 0,
222 af_blue_2_1_1
= af_blue_2_1
+ 2,
223 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
224 af_blue_2_1_2
= af_blue_2_1_1
+ 2,
226 af_blue_2_1_2
= af_blue_2_1_1
+ 0,
227 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
228 af_blue_2_2
= af_blue_2_1_2
+ 1,
230 af_blue_2_2
= af_blue_2_1
+ 0,
231 #endif /* AF_CONFIG_OPTION_CJK */
234 AF_BLUE_STRINGSET_MAX
/* do not remove */
239 typedef struct AF_Blue_StringRec_
241 AF_Blue_String string
;
242 FT_UShort properties
;
247 FT_LOCAL_ARRAY( AF_Blue_StringRec
)
248 af_blue_stringsets
[];
255 #endif /* AFBLUE_H_ */