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-2015 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_CYRILLIC_CAPITAL_TOP = 36, 84 AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 60, 85 AF_BLUE_STRING_CYRILLIC_SMALL = 84, 86 AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 108, 87 AF_BLUE_STRING_DEVANAGARI_BASE = 117, 88 AF_BLUE_STRING_DEVANAGARI_TOP = 149, 89 AF_BLUE_STRING_DEVANAGARI_HEAD = 181, 90 AF_BLUE_STRING_DEVANAGARI_BOTTOM = 213, 91 AF_BLUE_STRING_GREEK_CAPITAL_TOP = 221, 92 AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 242, 93 AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 260, 94 AF_BLUE_STRING_GREEK_SMALL = 278, 95 AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 302, 96 AF_BLUE_STRING_HEBREW_TOP = 326, 97 AF_BLUE_STRING_HEBREW_BOTTOM = 350, 98 AF_BLUE_STRING_HEBREW_DESCENDER = 368, 99 AF_BLUE_STRING_KHMER_TOP = 383, 100 AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP = 407, 101 AF_BLUE_STRING_KHMER_BOTTOM = 447, 102 AF_BLUE_STRING_KHMER_DESCENDER = 479, 103 AF_BLUE_STRING_KHMER_LARGE_DESCENDER = 513, 104 AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP = 600, 105 AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM = 608, 106 AF_BLUE_STRING_LAO_TOP = 616, 107 AF_BLUE_STRING_LAO_BOTTOM = 648, 108 AF_BLUE_STRING_LAO_ASCENDER = 680, 109 AF_BLUE_STRING_LAO_LARGE_ASCENDER = 696, 110 AF_BLUE_STRING_LAO_DESCENDER = 708, 111 AF_BLUE_STRING_LATIN_CAPITAL_TOP = 732, 112 AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 748, 113 AF_BLUE_STRING_LATIN_SMALL_F_TOP = 764, 114 AF_BLUE_STRING_LATIN_SMALL = 778, 115 AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 792, 116 AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 802, 117 AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 822, 118 AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 842, 119 AF_BLUE_STRING_LATIN_SUBS_SMALL = 862, 120 AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 898, 121 AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 918, 122 AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 949, 123 AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 978, 124 AF_BLUE_STRING_LATIN_SUPS_SMALL = 1004, 125 AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 1029, 126 AF_BLUE_STRING_MYANMAR_TOP = 1040, 127 AF_BLUE_STRING_MYANMAR_BOTTOM = 1072, 128 AF_BLUE_STRING_MYANMAR_ASCENDER = 1104, 129 AF_BLUE_STRING_MYANMAR_DESCENDER = 1132, 130 AF_BLUE_STRING_TELUGU_TOP = 1164, 131 AF_BLUE_STRING_TELUGU_BOTTOM = 1192, 132 AF_BLUE_STRING_THAI_TOP = 1220, 133 AF_BLUE_STRING_THAI_BOTTOM = 1244, 134 AF_BLUE_STRING_THAI_ASCENDER = 1272, 135 AF_BLUE_STRING_THAI_LARGE_ASCENDER = 1284, 136 AF_BLUE_STRING_THAI_DESCENDER = 1296, 137 AF_BLUE_STRING_THAI_LARGE_DESCENDER = 1312, 138 AF_BLUE_STRING_THAI_DIGIT_TOP = 1320, 139 af_blue_1_1 = 1331, 140 #ifdef AF_CONFIG_OPTION_CJK 141 AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1, 142 AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 203, 143 af_blue_1_1_1 = af_blue_1_1 + 404, 144 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT 145 AF_BLUE_STRING_CJK_LEFT = af_blue_1_1_1 + 1, 146 AF_BLUE_STRING_CJK_RIGHT = af_blue_1_1_1 + 204, 147 af_blue_1_1_2 = af_blue_1_1_1 + 405, 148 #else 149 af_blue_1_1_2 = af_blue_1_1_1 + 0, 150 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ 151 af_blue_1_2 = af_blue_1_1_2 + 0, 152 #else 153 af_blue_1_2 = af_blue_1_1 + 0, 154 #endif /* AF_CONFIG_OPTION_CJK */ 155 156 157 AF_BLUE_STRING_MAX /* do not remove */ 158 159 } AF_Blue_String; 160 161 162 FT_LOCAL_ARRAY( char ) 163 af_blue_strings[]; 164 165 166 /*************************************************************************/ 167 /*************************************************************************/ 168 /***** *****/ 169 /***** B L U E S T R I N G S E T S *****/ 170 /***** *****/ 171 /*************************************************************************/ 172 /*************************************************************************/ 173 174 /* The next level is to group blue strings into style-specific sets. */ 175 176 177 /* Properties are specific to a writing system. We assume that a given */ 178 /* blue string can't be used in more than a single writing system, which */ 179 /* is a safe bet. */ 180 #define AF_BLUE_PROPERTY_LATIN_TOP ( 1U << 0 ) /* must have value 1 */ 181 #define AF_BLUE_PROPERTY_LATIN_SUB_TOP ( 1U << 1 ) 182 #define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1U << 2 ) 183 #define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1U << 3 ) 184 #define AF_BLUE_PROPERTY_LATIN_LONG ( 1U << 4 ) 185 186 #define AF_BLUE_PROPERTY_CJK_TOP ( 1U << 0 ) /* must have value 1 */ 187 #define AF_BLUE_PROPERTY_CJK_HORIZ ( 1U << 1 ) /* must have value 2 */ 188 #define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP 189 190 191 #define AF_BLUE_STRINGSET_MAX_LEN 8 192 193 /* The AF_Blue_Stringset enumeration values are offsets into the */ 194 /* `af_blue_stringsets' array. */ 195 196 typedef enum AF_Blue_Stringset_ 197 { 198 AF_BLUE_STRINGSET_ARAB = 0, 199 AF_BLUE_STRINGSET_CYRL = 4, 200 AF_BLUE_STRINGSET_DEVA = 10, 201 AF_BLUE_STRINGSET_GREK = 16, 202 AF_BLUE_STRINGSET_HEBR = 23, 203 AF_BLUE_STRINGSET_KHMR = 27, 204 AF_BLUE_STRINGSET_KHMS = 33, 205 AF_BLUE_STRINGSET_LAO = 36, 206 AF_BLUE_STRINGSET_LATN = 42, 207 AF_BLUE_STRINGSET_LATB = 49, 208 AF_BLUE_STRINGSET_LATP = 56, 209 AF_BLUE_STRINGSET_MYMR = 63, 210 AF_BLUE_STRINGSET_TELU = 68, 211 AF_BLUE_STRINGSET_THAI = 71, 212 af_blue_2_1 = 79, 213 #ifdef AF_CONFIG_OPTION_CJK 214 AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0, 215 af_blue_2_1_1 = af_blue_2_1 + 2, 216 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT 217 af_blue_2_1_2 = af_blue_2_1_1 + 2, 218 #else 219 af_blue_2_1_2 = af_blue_2_1_1 + 0, 220 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ 221 af_blue_2_2 = af_blue_2_1_2 + 1, 222 #else 223 af_blue_2_2 = af_blue_2_1 + 0, 224 #endif /* AF_CONFIG_OPTION_CJK */ 225 226 227 AF_BLUE_STRINGSET_MAX /* do not remove */ 228 229 } AF_Blue_Stringset; 230 231 232 typedef struct AF_Blue_StringRec_ 233 { 234 AF_Blue_String string; 235 FT_UShort properties; 236 237 } AF_Blue_StringRec; 238 239 240 FT_LOCAL_ARRAY( AF_Blue_StringRec ) 241 af_blue_stringsets[]; 242 243 /* */ 244 245 FT_END_HEADER 246 247 248 #endif /* __AFBLUE_H__ */ 249 250 251 /* END */ 252