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, 2014 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 ) \
32 ch = (unsigned char)*p++; \
43 else if ( ch < 0xF0 ) \
54 for ( ; len > 0; len-- ) \
55 ch = ( ch << 6 ) | ( *p++ & 0x3F ); \
59 /*************************************************************************/
60 /*************************************************************************/
62 /***** B L U E S T R I N G S *****/
64 /*************************************************************************/
65 /*************************************************************************/
67 /* At the bottommost level, we define strings for finding blue zones. */
70 #define AF_BLUE_STRING_MAX_LEN 51
72 /* The AF_Blue_String enumeration values are offsets into the */
73 /* `af_blue_strings' array. */
75 typedef enum AF_Blue_String_
77 AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 0,
78 AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 17,
79 AF_BLUE_STRING_CYRILLIC_SMALL = 34,
80 AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 51,
81 AF_BLUE_STRING_DEVANAGARI_BASE = 58,
82 AF_BLUE_STRING_DEVANAGARI_TOP = 83,
83 AF_BLUE_STRING_DEVANAGARI_HEAD = 108,
84 AF_BLUE_STRING_DEVANAGARI_BOTTOM = 133,
85 AF_BLUE_STRING_GREEK_CAPITAL_TOP = 140,
86 AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 155,
87 AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 168,
88 AF_BLUE_STRING_GREEK_SMALL = 181,
89 AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 198,
90 AF_BLUE_STRING_HEBREW_TOP = 215,
91 AF_BLUE_STRING_HEBREW_BOTTOM = 232,
92 AF_BLUE_STRING_HEBREW_DESCENDER = 245,
93 AF_BLUE_STRING_LATIN_CAPITAL_TOP = 256,
94 AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 265,
95 AF_BLUE_STRING_LATIN_SMALL_F_TOP = 274,
96 AF_BLUE_STRING_LATIN_SMALL = 282,
97 AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 290,
98 AF_BLUE_STRING_TELUGU_TOP = 296,
99 AF_BLUE_STRING_TELUGU_BOTTOM = 318,
101 #ifdef AF_CONFIG_OPTION_CJK
102 AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1,
103 AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 153,
104 af_blue_1_1_1 = af_blue_1_1 + 304,
105 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
106 AF_BLUE_STRING_CJK_LEFT = af_blue_1_1_1 + 1,
107 AF_BLUE_STRING_CJK_RIGHT = af_blue_1_1_1 + 153,
108 af_blue_1_1_2 = af_blue_1_1_1 + 304,
110 af_blue_1_1_2 = af_blue_1_1_1 + 0,
111 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
112 af_blue_1_2 = af_blue_1_1_2 + 0,
114 af_blue_1_2 = af_blue_1_1 + 0,
115 #endif /* AF_CONFIG_OPTION_CJK */
118 AF_BLUE_STRING_MAX /* do not remove */
123 FT_LOCAL_ARRAY( char )
127 /*************************************************************************/
128 /*************************************************************************/
130 /***** B L U E S T R I N G S E T S *****/
132 /*************************************************************************/
133 /*************************************************************************/
135 /* The next level is to group blue strings into style-specific sets. */
138 /* Properties are specific to a writing system. We assume that a given */
139 /* blue string can't be used in more than a single writing system, which */
141 #define AF_BLUE_PROPERTY_LATIN_TOP ( 1 << 0 ) /* must have value 1 */
142 #define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1 << 1 )
143 #define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1 << 2 )
144 #define AF_BLUE_PROPERTY_LATIN_LONG ( 1 << 3 )
146 #define AF_BLUE_PROPERTY_CJK_TOP ( 1 << 0 ) /* must have value 1 */
147 #define AF_BLUE_PROPERTY_CJK_HORIZ ( 1 << 1 ) /* must have value 2 */
148 #define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP
151 #define AF_BLUE_STRINGSET_MAX_LEN 7
153 /* The AF_Blue_Stringset enumeration values are offsets into the */
154 /* `af_blue_stringsets' array. */
156 typedef enum AF_Blue_Stringset_
158 AF_BLUE_STRINGSET_CYRL = 0,
159 AF_BLUE_STRINGSET_DEVA = 6,
160 AF_BLUE_STRINGSET_GREK = 12,
161 AF_BLUE_STRINGSET_HEBR = 19,
162 AF_BLUE_STRINGSET_LATN = 23,
163 AF_BLUE_STRINGSET_TELU = 30,
165 #ifdef AF_CONFIG_OPTION_CJK
166 AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0,
167 af_blue_2_1_1 = af_blue_2_1 + 2,
168 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
169 af_blue_2_1_2 = af_blue_2_1_1 + 2,
171 af_blue_2_1_2 = af_blue_2_1_1 + 0,
172 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
173 af_blue_2_2 = af_blue_2_1_2 + 1,
175 af_blue_2_2 = af_blue_2_1 + 0,
176 #endif /* AF_CONFIG_OPTION_CJK */
179 AF_BLUE_STRINGSET_MAX /* do not remove */
184 typedef struct AF_Blue_StringRec_
186 AF_Blue_String string;
187 FT_UShort properties;
192 FT_LOCAL_ARRAY( AF_Blue_StringRec )
193 af_blue_stringsets[];
200 #endif /* __AFBLUE_H__ */