3 // Auto-fitter data for blue strings.
6 // David Turner, Robert Wilhelm, and Werner Lemberg.
8 // This file is part of the FreeType project, and may only be used,
9 // modified, and distributed under the terms of the FreeType project
10 // license, LICENSE.TXT. By continuing to use, modify, or distribute
11 // this file you indicate that you have read the license and
12 // understand and accept it fully.
15 // This file contains data specific to blue zones. It gets processed by
16 // a script to simulate `jagged arrays', with enumeration values holding
17 // offsets into the arrays.
19 // The format of the file is rather simple: A section starts with three
20 // labels separated by whitespace and followed by a colon (everything in a
21 // single line); the first label gives the name of the enumeration template,
22 // the second the name of the array template, and the third the name of the
23 // `maximum' template, holding the size of the largest array element. The
24 // script then fills the corresponding templates (indicated by `@'
25 // characters around the name).
27 // A section contains one or more data records. Each data record consists
28 // of two or more lines. The first line holds the enumeration name, and the
29 // remaining lines the corresponding array data.
31 // There are two possible representations for array data.
33 // - A string of characters in UTF-8 encoding enclosed in double quotes,
34 // using C syntax. There can be only one string per line, thus the
35 // starting and ending double quote must be the first and last character
36 // in the line, respectively, ignoring whitespace before and after the
37 // string. If there are multiple strings (in multiple lines), they are
38 // concatenated to a single string. In the output, a string gets
39 // represented as a series of singles bytes, followed by a zero byte. The
40 // enumeration values simply hold byte offsets to the start of the
41 // corresponding strings.
43 // - Data blocks enclosed in balanced braces, which get copied verbatim and
44 // which can span multiple lines. The opening brace of a block must be
45 // the first character of a line (ignoring whitespace), and the closing
46 // brace the last (ignoring whitespace also). The script appends a comma
47 // character after each block and counts the number of blocks to set the
48 // enumeration values.
50 // A section can contain either strings only or data blocks only.
52 // A comment line starts with `//'; it gets removed. A preprocessor
53 // directive line (using the standard syntax of `cpp') starts with `#' and
54 // gets copied verbatim to both the enumeration and the array. Whitespace
55 // outside of a string is insignificant.
57 // Preprocessor directives are ignored while the script computes maximum
58 // values; this essentially means that the maximum values can easily be too
59 // large. Given that the purpose of those values is to create local
60 // fixed-size arrays at compile time for further processing of the blue zone
61 // data, this isn't a problem. Note the the final zero byte of a string is
62 // not counted. Note also that the count holds the number of UTF-8 encoded
63 // characters, not bytes.
66 AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
68 AF_BLUE_STRING_LATIN_CAPITAL_TOP
70 AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM
72 AF_BLUE_STRING_LATIN_SMALL_F_TOP
74 AF_BLUE_STRING_LATIN_SMALL
76 AF_BLUE_STRING_LATIN_SMALL_DESCENDER
79 AF_BLUE_STRING_GREEK_CAPITAL_TOP
81 AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM
83 AF_BLUE_STRING_GREEK_SMALL_BETA_TOP
85 AF_BLUE_STRING_GREEK_SMALL
87 AF_BLUE_STRING_GREEK_SMALL_DESCENDER
90 AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP
92 AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM
94 AF_BLUE_STRING_CYRILLIC_SMALL
96 AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER
99 AF_BLUE_STRING_HEBREW_TOP
101 AF_BLUE_STRING_HEBREW_BOTTOM
103 AF_BLUE_STRING_HEBREW_DESCENDER
106 #ifdef AF_CONFIG_OPTION_CJK
108 AF_BLUE_STRING_CJK_TOP_FILL
113 AF_BLUE_STRING_CJK_TOP_UNFILL
118 AF_BLUE_STRING_CJK_BOTTOM_FILL
123 AF_BLUE_STRING_CJK_BOTTOM_UNFILL
129 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
131 AF_BLUE_STRING_CJK_LEFT_FILL
136 AF_BLUE_STRING_CJK_LEFT_UNFILL
141 AF_BLUE_STRING_CJK_RIGHT_FILL
146 AF_BLUE_STRING_CJK_RIGHT_UNFILL
152 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
154 #endif /* AF_CONFIG_OPTION_CJK */
157 AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
159 AF_BLUE_STRINGSET_LATN
160 { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
161 { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 }
162 { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
163 { AF_BLUE_STRING_LATIN_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
164 AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
165 { AF_BLUE_STRING_LATIN_SMALL, 0 }
166 { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 }
167 { AF_BLUE_STRING_MAX, 0 }
169 AF_BLUE_STRINGSET_GREK
170 { AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
171 { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 }
172 { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
173 { AF_BLUE_STRING_GREEK_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
174 AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
175 { AF_BLUE_STRING_GREEK_SMALL, 0 }
176 { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 }
177 { AF_BLUE_STRING_MAX, 0 }
179 AF_BLUE_STRINGSET_CYRL
180 { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
181 { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 }
182 { AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
183 AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
184 { AF_BLUE_STRING_CYRILLIC_SMALL, 0 }
185 { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 }
186 { AF_BLUE_STRING_MAX, 0 }
188 AF_BLUE_STRINGSET_HEBR
189 { AF_BLUE_STRING_HEBREW_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
190 AF_BLUE_PROPERTY_LATIN_LONG }
191 { AF_BLUE_STRING_HEBREW_BOTTOM, 0 }
192 { AF_BLUE_STRING_HEBREW_DESCENDER, 0 }
193 { AF_BLUE_STRING_MAX, 0 }
195 #ifdef AF_CONFIG_OPTION_CJK
197 AF_BLUE_STRINGSET_HANI
198 { AF_BLUE_STRING_CJK_TOP_FILL, AF_BLUE_PROPERTY_CJK_TOP |
199 AF_BLUE_PROPERTY_CJK_FILL }
200 { AF_BLUE_STRING_CJK_TOP_UNFILL, AF_BLUE_PROPERTY_CJK_TOP }
201 { AF_BLUE_STRING_CJK_BOTTOM_FILL, AF_BLUE_PROPERTY_CJK_FILL }
202 { AF_BLUE_STRING_CJK_BOTTOM_UNFILL, 0 }
203 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
204 { AF_BLUE_STRING_CJK_LEFT_FILL, AF_BLUE_PROPERTY_CJK_HORIZ |
205 AF_BLUE_PROPERTY_CJK_FILL }
206 { AF_BLUE_STRING_CJK_LEFT_UNFILL, AF_BLUE_PROPERTY_CJK_HORIZ }
207 { AF_BLUE_STRING_CJK_RIGHT_FILL, AF_BLUE_PROPERTY_CJK_HORIZ |
208 AF_BLUE_PROPERTY_CJK_RIGHT |
209 AF_BLUE_PROPERTY_CJK_FILL }
210 { AF_BLUE_STRING_CJK_RIGHT_UNFILL, AF_BLUE_PROPERTY_CJK_HORIZ |
211 AF_BLUE_PROPERTY_CJK_RIGHT }
212 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
213 { AF_BLUE_STRING_MAX, 0 }
215 #endif /* AF_CONFIG_OPTION_CJK */