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 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 ch = (unsigned char)*p++; \ 33 if ( ch >= 0x80 ) \ 34 { \ 35 FT_UInt len; \ 36 \ 37 \ 38 if ( ch < 0xE0 ) \ 39 { \ 40 len = 1; \ 41 ch &= 0x1F; \ 42 } \ 43 else if ( ch < 0xF0 ) \ 44 { \ 45 len = 2; \ 46 ch &= 0x0F; \ 47 } \ 48 else \ 49 { \ 50 len = 3; \ 51 ch &= 0x07; \ 52 } \ 53 \ 54 for ( ; len > 0; len-- ) \ 55 ch = ( ch << 6 ) | ( *p++ & 0x3F ); \ 56 } 57 58 59 /*************************************************************************/ 60 /*************************************************************************/ 61 /***** *****/ 62 /***** B L U E S T R I N G S *****/ 63 /***** *****/ 64 /*************************************************************************/ 65 /*************************************************************************/ 66 67 /* At the bottommost level, we define strings for finding blue zones. */ 68 69 70 #define AF_BLUE_STRING_MAX_LEN 25 71 72 /* The AF_Blue_String enumeration values are offsets into the */ 73 /* `af_blue_strings' array. */ 74 75 typedef enum AF_Blue_String_ 76 { 77 AF_BLUE_STRING_LATIN_CAPITAL_TOP = 0, 78 AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 9, 79 AF_BLUE_STRING_LATIN_SMALL_F_TOP = 18, 80 AF_BLUE_STRING_LATIN_SMALL = 26, 81 AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 34, 82 AF_BLUE_STRING_GREEK_CAPITAL_TOP = 40, 83 AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 55, 84 AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 68, 85 AF_BLUE_STRING_GREEK_SMALL = 81, 86 AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 98, 87 AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 115, 88 AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 132, 89 AF_BLUE_STRING_CYRILLIC_SMALL = 149, 90 AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 166, 91 AF_BLUE_STRING_HEBREW_TOP = 173, 92 AF_BLUE_STRING_HEBREW_BOTTOM = 190, 93 AF_BLUE_STRING_HEBREW_DESCENDER = 203, 94 af_blue_1_1 = 213, 95 #ifdef AF_CONFIG_OPTION_CJK 96 AF_BLUE_STRING_CJK_TOP_FILL = af_blue_1_1 + 1, 97 AF_BLUE_STRING_CJK_TOP_UNFILL = af_blue_1_1 + 77, 98 AF_BLUE_STRING_CJK_BOTTOM_FILL = af_blue_1_1 + 153, 99 AF_BLUE_STRING_CJK_BOTTOM_UNFILL = af_blue_1_1 + 229, 100 af_blue_1_1_1 = af_blue_1_1 + 304, 101 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT 102 AF_BLUE_STRING_CJK_LEFT_FILL = af_blue_1_1_1 + 1, 103 AF_BLUE_STRING_CJK_LEFT_UNFILL = af_blue_1_1_1 + 77, 104 AF_BLUE_STRING_CJK_RIGHT_FILL = af_blue_1_1_1 + 153, 105 AF_BLUE_STRING_CJK_RIGHT_UNFILL = af_blue_1_1_1 + 229, 106 af_blue_1_1_2 = af_blue_1_1_1 + 304, 107 #else 108 af_blue_1_1_2 = af_blue_1_1_1 + 0, 109 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ 110 af_blue_1_2 = af_blue_1_1_2 + 0, 111 #else 112 af_blue_1_2 = af_blue_1_1 + 0, 113 #endif /* AF_CONFIG_OPTION_CJK */ 114 115 116 AF_BLUE_STRING_MAX /* do not remove */ 117 118 } AF_Blue_String; 119 120 121 FT_LOCAL_ARRAY( char ) 122 af_blue_strings[]; 123 124 125 /*************************************************************************/ 126 /*************************************************************************/ 127 /***** *****/ 128 /***** B L U E S T R I N G S E T S *****/ 129 /***** *****/ 130 /*************************************************************************/ 131 /*************************************************************************/ 132 133 /* The next level is to group blue strings into style-specific sets. */ 134 135 136 /* Properties are specific to a writing system. We assume that a given */ 137 /* blue string can't be used in more than a single writing system, which */ 138 /* is a safe bet. */ 139 #define AF_BLUE_PROPERTY_LATIN_TOP ( 1 << 0 ) 140 #define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1 << 1 ) 141 #define AF_BLUE_PROPERTY_LATIN_LONG ( 1 << 2 ) 142 143 #define AF_BLUE_PROPERTY_CJK_HORIZ ( 1 << 0 ) 144 #define AF_BLUE_PROPERTY_CJK_TOP ( 1 << 1 ) 145 #define AF_BLUE_PROPERTY_CJK_FILL ( 1 << 2 ) 146 #define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP 147 148 149 #define AF_BLUE_STRINGSET_MAX_LEN 9 150 151 /* The AF_Blue_Stringset enumeration values are offsets into the */ 152 /* `af_blue_stringsets' array. */ 153 154 typedef enum AF_Blue_Stringset_ 155 { 156 AF_BLUE_STRINGSET_LATN = 0, 157 AF_BLUE_STRINGSET_GREK = 7, 158 AF_BLUE_STRINGSET_CYRL = 14, 159 AF_BLUE_STRINGSET_HEBR = 20, 160 af_blue_2_1 = 24, 161 #ifdef AF_CONFIG_OPTION_CJK 162 AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0, 163 af_blue_2_1_1 = af_blue_2_1 + 4, 164 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT 165 af_blue_2_1_2 = af_blue_2_1_1 + 4, 166 #else 167 af_blue_2_1_2 = af_blue_2_1_1 + 0, 168 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ 169 af_blue_2_2 = af_blue_2_1_2 + 1, 170 #else 171 af_blue_2_2 = af_blue_2_1 + 0, 172 #endif /* AF_CONFIG_OPTION_CJK */ 173 174 175 AF_BLUE_STRINGSET_MAX /* do not remove */ 176 177 } AF_Blue_Stringset; 178 179 180 typedef struct AF_Blue_StringRec_ 181 { 182 AF_Blue_String string; 183 FT_UShort properties; 184 185 } AF_Blue_StringRec; 186 187 188 FT_LOCAL_ARRAY( AF_Blue_StringRec ) 189 af_blue_stringsets[]; 190 191 /* */ 192 193 FT_END_HEADER 194 195 196 #endif /* __AFBLUE_H__ */ 197 198 199 /* END */ 200