1 /* This file has been generated by the Perl script `afblue.pl', */ 2 /* using data from file `afblue.dat'. */ 3 4 /***************************************************************************/ 5 /* */ 6 /* afblue.h */ 7 /* */ 8 /* Auto-fitter data for blue strings (specification). */ 9 /* */ 10 /* Copyright 2013-2016 by */ 11 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 12 /* */ 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. */ 18 /* */ 19 /***************************************************************************/ 20 21 22 #ifndef AFBLUE_H_ 23 #define AFBLUE_H_ 24 25 26 FT_BEGIN_HEADER 27 28 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 ) \ 32 do \ 33 { \ 34 ch = (unsigned char)*p++; \ 35 if ( ch >= 0x80 ) \ 36 { \ 37 FT_UInt len_; \ 38 \ 39 \ 40 if ( ch < 0xE0 ) \ 41 { \ 42 len_ = 1; \ 43 ch &= 0x1F; \ 44 } \ 45 else if ( ch < 0xF0 ) \ 46 { \ 47 len_ = 2; \ 48 ch &= 0x0F; \ 49 } \ 50 else \ 51 { \ 52 len_ = 3; \ 53 ch &= 0x07; \ 54 } \ 55 \ 56 for ( ; len_ > 0; len_-- ) \ 57 ch = ( ch << 6 ) | ( *p++ & 0x3F ); \ 58 } \ 59 } while ( 0 ) 60 61 62 /*************************************************************************/ 63 /*************************************************************************/ 64 /***** *****/ 65 /***** B L U E S T R I N G S *****/ 66 /***** *****/ 67 /*************************************************************************/ 68 /*************************************************************************/ 69 70 /* At the bottommost level, we define strings for finding blue zones. */ 71 72 73 #define AF_BLUE_STRING_MAX_LEN 51 74 75 /* The AF_Blue_String enumeration values are offsets into the */ 76 /* `af_blue_strings' array. */ 77 78 typedef enum AF_Blue_String_ 79 { 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_ARMENIAN_CAPITAL_TOP = 36, 84 AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM = 60, 85 AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER = 84, 86 AF_BLUE_STRING_ARMENIAN_SMALL_TOP = 105, 87 AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM = 129, 88 AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER = 153, 89 AF_BLUE_STRING_BENGALI_BASE = 177, 90 AF_BLUE_STRING_BENGALI_TOP = 209, 91 AF_BLUE_STRING_BENGALI_HEAD = 237, 92 AF_BLUE_STRING_CHEROKEE_CAPITAL = 269, 93 AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER = 301, 94 AF_BLUE_STRING_CHEROKEE_SMALL = 333, 95 AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER = 365, 96 AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 381, 97 AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 405, 98 AF_BLUE_STRING_CYRILLIC_SMALL = 429, 99 AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 453, 100 AF_BLUE_STRING_DEVANAGARI_BASE = 462, 101 AF_BLUE_STRING_DEVANAGARI_TOP = 494, 102 AF_BLUE_STRING_DEVANAGARI_HEAD = 526, 103 AF_BLUE_STRING_DEVANAGARI_BOTTOM = 558, 104 AF_BLUE_STRING_ETHIOPIC_TOP = 566, 105 AF_BLUE_STRING_ETHIOPIC_BOTTOM = 598, 106 AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP = 630, 107 AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM = 662, 108 AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER = 694, 109 AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER = 726, 110 AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP = 758, 111 AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM = 790, 112 AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP = 822, 113 AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM = 854, 114 AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER = 886, 115 AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER = 918, 116 AF_BLUE_STRING_GREEK_CAPITAL_TOP = 950, 117 AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 971, 118 AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 989, 119 AF_BLUE_STRING_GREEK_SMALL = 1007, 120 AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 1031, 121 AF_BLUE_STRING_GUJARATI_TOP = 1055, 122 AF_BLUE_STRING_GUJARATI_BOTTOM = 1087, 123 AF_BLUE_STRING_GUJARATI_ASCENDER = 1119, 124 AF_BLUE_STRING_GUJARATI_DESCENDER = 1169, 125 AF_BLUE_STRING_GUJARATI_DIGIT_TOP = 1202, 126 AF_BLUE_STRING_GURMUKHI_BASE = 1222, 127 AF_BLUE_STRING_GURMUKHI_HEAD = 1254, 128 AF_BLUE_STRING_GURMUKHI_TOP = 1286, 129 AF_BLUE_STRING_GURMUKHI_BOTTOM = 1318, 130 AF_BLUE_STRING_GURMUKHI_DIGIT_TOP = 1350, 131 AF_BLUE_STRING_HEBREW_TOP = 1370, 132 AF_BLUE_STRING_HEBREW_BOTTOM = 1394, 133 AF_BLUE_STRING_HEBREW_DESCENDER = 1412, 134 AF_BLUE_STRING_KANNADA_TOP = 1427, 135 AF_BLUE_STRING_KANNADA_BOTTOM = 1471, 136 AF_BLUE_STRING_KHMER_TOP = 1503, 137 AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP = 1527, 138 AF_BLUE_STRING_KHMER_BOTTOM = 1567, 139 AF_BLUE_STRING_KHMER_DESCENDER = 1599, 140 AF_BLUE_STRING_KHMER_LARGE_DESCENDER = 1633, 141 AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP = 1720, 142 AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM = 1728, 143 AF_BLUE_STRING_LAO_TOP = 1736, 144 AF_BLUE_STRING_LAO_BOTTOM = 1768, 145 AF_BLUE_STRING_LAO_ASCENDER = 1800, 146 AF_BLUE_STRING_LAO_LARGE_ASCENDER = 1816, 147 AF_BLUE_STRING_LAO_DESCENDER = 1828, 148 AF_BLUE_STRING_LATIN_CAPITAL_TOP = 1852, 149 AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 1868, 150 AF_BLUE_STRING_LATIN_SMALL_F_TOP = 1884, 151 AF_BLUE_STRING_LATIN_SMALL = 1898, 152 AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 1912, 153 AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 1922, 154 AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 1942, 155 AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 1962, 156 AF_BLUE_STRING_LATIN_SUBS_SMALL = 1982, 157 AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 2018, 158 AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 2038, 159 AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 2069, 160 AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 2098, 161 AF_BLUE_STRING_LATIN_SUPS_SMALL = 2124, 162 AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 2149, 163 AF_BLUE_STRING_MALAYALAM_TOP = 2160, 164 AF_BLUE_STRING_MALAYALAM_BOTTOM = 2204, 165 AF_BLUE_STRING_MYANMAR_TOP = 2236, 166 AF_BLUE_STRING_MYANMAR_BOTTOM = 2268, 167 AF_BLUE_STRING_MYANMAR_ASCENDER = 2300, 168 AF_BLUE_STRING_MYANMAR_DESCENDER = 2328, 169 AF_BLUE_STRING_SINHALA_TOP = 2360, 170 AF_BLUE_STRING_SINHALA_BOTTOM = 2392, 171 AF_BLUE_STRING_SINHALA_DESCENDER = 2424, 172 AF_BLUE_STRING_TAMIL_TOP = 2468, 173 AF_BLUE_STRING_TAMIL_BOTTOM = 2500, 174 AF_BLUE_STRING_TELUGU_TOP = 2532, 175 AF_BLUE_STRING_TELUGU_BOTTOM = 2560, 176 AF_BLUE_STRING_THAI_TOP = 2588, 177 AF_BLUE_STRING_THAI_BOTTOM = 2612, 178 AF_BLUE_STRING_THAI_ASCENDER = 2640, 179 AF_BLUE_STRING_THAI_LARGE_ASCENDER = 2652, 180 AF_BLUE_STRING_THAI_DESCENDER = 2664, 181 AF_BLUE_STRING_THAI_LARGE_DESCENDER = 2680, 182 AF_BLUE_STRING_THAI_DIGIT_TOP = 2688, 183 af_blue_1_1 = 2699, 184 #ifdef AF_CONFIG_OPTION_CJK 185 AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1, 186 AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 203, 187 af_blue_1_1_1 = af_blue_1_1 + 404, 188 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT 189 AF_BLUE_STRING_CJK_LEFT = af_blue_1_1_1 + 1, 190 AF_BLUE_STRING_CJK_RIGHT = af_blue_1_1_1 + 204, 191 af_blue_1_1_2 = af_blue_1_1_1 + 405, 192 #else 193 af_blue_1_1_2 = af_blue_1_1_1 + 0, 194 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ 195 af_blue_1_2 = af_blue_1_1_2 + 0, 196 #else 197 af_blue_1_2 = af_blue_1_1 + 0, 198 #endif /* AF_CONFIG_OPTION_CJK */ 199 200 201 AF_BLUE_STRING_MAX /* do not remove */ 202 203 } AF_Blue_String; 204 205 206 FT_LOCAL_ARRAY( char ) 207 af_blue_strings[]; 208 209 210 /*************************************************************************/ 211 /*************************************************************************/ 212 /***** *****/ 213 /***** B L U E S T R I N G S E T S *****/ 214 /***** *****/ 215 /*************************************************************************/ 216 /*************************************************************************/ 217 218 /* The next level is to group blue strings into style-specific sets. */ 219 220 221 /* Properties are specific to a writing system. We assume that a given */ 222 /* blue string can't be used in more than a single writing system, which */ 223 /* is a safe bet. */ 224 #define AF_BLUE_PROPERTY_LATIN_TOP ( 1U << 0 ) /* must have value 1 */ 225 #define AF_BLUE_PROPERTY_LATIN_SUB_TOP ( 1U << 1 ) 226 #define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1U << 2 ) 227 #define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1U << 3 ) 228 #define AF_BLUE_PROPERTY_LATIN_LONG ( 1U << 4 ) 229 230 #define AF_BLUE_PROPERTY_CJK_TOP ( 1U << 0 ) /* must have value 1 */ 231 #define AF_BLUE_PROPERTY_CJK_HORIZ ( 1U << 1 ) /* must have value 2 */ 232 #define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP 233 234 235 #define AF_BLUE_STRINGSET_MAX_LEN 8 236 237 /* The AF_Blue_Stringset enumeration values are offsets into the */ 238 /* `af_blue_stringsets' array. */ 239 240 typedef enum AF_Blue_Stringset_ 241 { 242 AF_BLUE_STRINGSET_ARAB = 0, 243 AF_BLUE_STRINGSET_ARMN = 4, 244 AF_BLUE_STRINGSET_BENG = 11, 245 AF_BLUE_STRINGSET_CHER = 16, 246 AF_BLUE_STRINGSET_CYRL = 23, 247 AF_BLUE_STRINGSET_DEVA = 29, 248 AF_BLUE_STRINGSET_ETHI = 35, 249 AF_BLUE_STRINGSET_GEOR = 38, 250 AF_BLUE_STRINGSET_GEOK = 43, 251 AF_BLUE_STRINGSET_GREK = 50, 252 AF_BLUE_STRINGSET_GUJR = 57, 253 AF_BLUE_STRINGSET_GURU = 63, 254 AF_BLUE_STRINGSET_HEBR = 69, 255 AF_BLUE_STRINGSET_KNDA = 73, 256 AF_BLUE_STRINGSET_KHMR = 76, 257 AF_BLUE_STRINGSET_KHMS = 82, 258 AF_BLUE_STRINGSET_LAO = 85, 259 AF_BLUE_STRINGSET_LATN = 91, 260 AF_BLUE_STRINGSET_LATB = 98, 261 AF_BLUE_STRINGSET_LATP = 105, 262 AF_BLUE_STRINGSET_MLYM = 112, 263 AF_BLUE_STRINGSET_MYMR = 115, 264 AF_BLUE_STRINGSET_NONE = 120, 265 AF_BLUE_STRINGSET_SINH = 121, 266 AF_BLUE_STRINGSET_TAML = 125, 267 AF_BLUE_STRINGSET_TELU = 128, 268 AF_BLUE_STRINGSET_THAI = 131, 269 af_blue_2_1 = 139, 270 #ifdef AF_CONFIG_OPTION_CJK 271 AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0, 272 af_blue_2_1_1 = af_blue_2_1 + 2, 273 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT 274 af_blue_2_1_2 = af_blue_2_1_1 + 2, 275 #else 276 af_blue_2_1_2 = af_blue_2_1_1 + 0, 277 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ 278 af_blue_2_2 = af_blue_2_1_2 + 1, 279 #else 280 af_blue_2_2 = af_blue_2_1 + 0, 281 #endif /* AF_CONFIG_OPTION_CJK */ 282 283 284 AF_BLUE_STRINGSET_MAX /* do not remove */ 285 286 } AF_Blue_Stringset; 287 288 289 typedef struct AF_Blue_StringRec_ 290 { 291 AF_Blue_String string; 292 FT_UShort properties; 293 294 } AF_Blue_StringRec; 295 296 297 FT_LOCAL_ARRAY( AF_Blue_StringRec ) 298 af_blue_stringsets[]; 299 300 /* */ 301 302 FT_END_HEADER 303 304 305 #endif /* AFBLUE_H_ */ 306 307 308 /* END */ 309