tizen 2.3.1 release
[framework/graphics/freetype.git] / src / autofit / afblue.dat
1 //  afblue.dat
2 //
3 //    Auto-fitter data for blue strings.
4 //
5 //  Copyright 2013, 2014 by
6 //  David Turner, Robert Wilhelm, and Werner Lemberg.
7 //
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.
13
14
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.
18 //
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).
26 //
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.
30 //
31 // There are two possible representations for array data.
32 //
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.  Space characters within the string are ignored too.  If there
38 //   are multiple strings (in multiple lines), they are concatenated to a
39 //   single string.  In the output, a string gets represented as a series of
40 //   singles bytes, followed by a zero byte.  The enumeration values simply
41 //   hold byte offsets to the start of the corresponding strings.
42 //
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.
49 //
50 // A section can contain either strings only or data blocks only.
51 //
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.
56 //
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.
64
65
66 // The blue zone string data, to be used in the blue stringsets below.
67
68 AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
69
70   AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP
71     "БВЕПЗОСЭ"
72   AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM
73     "БВЕШЗОСЭ"
74   AF_BLUE_STRING_CYRILLIC_SMALL
75     "хпншезос"
76   AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER
77     "руф"
78
79   // we separate the letters with spaces to avoid ligatures;
80   // this is just for convenience to simplify reading
81   AF_BLUE_STRING_DEVANAGARI_BASE
82     "क म अ आ थ ध भ श"
83   AF_BLUE_STRING_DEVANAGARI_TOP
84     "ई ऐ ओ औ ि ी ो ौ"
85   // note that some fonts have extreme variation in the height of the
86   // round head elements; for this reason we also define the `base'
87   // blue zone, which must be always present
88   AF_BLUE_STRING_DEVANAGARI_HEAD
89     "क म अ आ थ ध भ श"
90   AF_BLUE_STRING_DEVANAGARI_BOTTOM
91     "ु ृ"
92
93   AF_BLUE_STRING_GREEK_CAPITAL_TOP
94     "ΓΒΕΖΘΟΩ"
95   AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM
96     "ΒΔΖΞΘΟ"
97   AF_BLUE_STRING_GREEK_SMALL_BETA_TOP
98     "βθδζλξ"
99   AF_BLUE_STRING_GREEK_SMALL
100     "αειοπστω"
101   AF_BLUE_STRING_GREEK_SMALL_DESCENDER
102     "βγημρφχψ"
103
104   AF_BLUE_STRING_HEBREW_TOP
105     "בדהחךכםס"
106   AF_BLUE_STRING_HEBREW_BOTTOM
107     "בטכםסצ"
108   AF_BLUE_STRING_HEBREW_DESCENDER
109     "קךןףץ"
110
111   AF_BLUE_STRING_LATIN_CAPITAL_TOP
112     "THEZOCQS"
113   AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM
114     "HEZLOCUS"
115   AF_BLUE_STRING_LATIN_SMALL_F_TOP
116     "fijkdbh"
117   AF_BLUE_STRING_LATIN_SMALL
118     "xzroesc"
119   AF_BLUE_STRING_LATIN_SMALL_DESCENDER
120     "pqgjy"
121
122   // we separate the letters with spaces to avoid ligatures;
123   // this is just for convenience to simplify reading
124   AF_BLUE_STRING_TELUGU_TOP
125     "ఇ ఌ ఙ ఞ ణ ఱ ౯"
126
127   AF_BLUE_STRING_TELUGU_BOTTOM
128     "అ క చ ర ఽ ౨ ౬"
129
130 #ifdef AF_CONFIG_OPTION_CJK
131
132   AF_BLUE_STRING_CJK_TOP
133     "他们你來們到和地"
134     "对對就席我时時會"
135     "来為能舰說说这這"
136     "齊 |"
137     "军同已愿既星是景"
138     "民照现現理用置要"
139     "軍那配里開雷露面"
140     "顾"
141   AF_BLUE_STRING_CJK_BOTTOM
142     "个为人他以们你來"
143     "個們到和大对對就"
144     "我时時有来為要說"
145     "说 |"
146     "主些因它想意理生"
147     "當看着置者自著裡"
148     "过还进進過道還里"
149     "面"
150
151 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
152
153   AF_BLUE_STRING_CJK_LEFT
154     "些们你來們到和地"
155     "她将將就年得情最"
156     "样樣理能說说这這"
157     "通 |"
158     "即吗吧听呢品响嗎"
159     "师師收断斷明眼間"
160     "间际陈限除陳随際"
161     "隨"
162   AF_BLUE_STRING_CJK_RIGHT
163     "事前學将將情想或"
164     "政斯新样樣民沒没"
165     "然特现現球第經谁"
166     "起 |"
167     "例別别制动動吗嗎"
168     "增指明朝期构物确"
169     "种調调費费那都間"
170     "间"
171
172 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
173
174 #endif /* AF_CONFIG_OPTION_CJK                */
175
176
177 // The blue zone stringsets, as used in the script styles, cf. `afstyles.h'.
178 //
179 // The AF_BLUE_PROPERTY_XXX flags are defined in `afblue.h'; here some
180 // explanations.
181 //
182 // A blue zone in general is defined by a reference and an overshoot line.
183 // During the hinting process, all coordinate values between those two lines
184 // are set equal to the reference value, provided that the blue zone is not
185 // wider than 0.75 pixels (otherwise the blue zone gets ignored).  All
186 // entries must have `AF_BLUE_STRING_MAX' as the final line.
187 //
188 // During the glyph analysis, edges are sorted from bottom to top, and then
189 // sequentially checked, edge by edge, against the blue zones in the order
190 // given below.
191 //
192 //
193 // latin auto-hinter
194 // -----------------
195 //
196 // Characters in a blue string are automatically classified as having a flat
197 // (reference) or a round (overshoot) extremum.  The blue zone is then set
198 // up by the mean values of all flat extrema and all round extrema,
199 // respectively.  Only horizontal blue zones (i.e., adjusting vertical
200 // coordinate values) are supported.
201 //
202 // For the latin auto-hinter, the overshoot should be larger than the
203 // reference for top zones, and vice versa for bottom zones.
204 //
205 //   LATIN_TOP
206 //     Take the maximum flat and round coordinate values of the blue string
207 //     characters for computing the blue zone's reference and overshoot
208 //     values.
209 //
210 //     If not set, take the minimum values.
211 //
212 //   LATIN_NEUTRAL
213 //     Ignore round extrema and define the blue zone with flat values only.
214 //     Both top and bottom of contours can match.  This is useful for
215 //     scripts like Devanagari where vowel signs attach to the base
216 //     character and are implemented as components of composite glyphs.
217 //
218 //     If not set, both round and flat extrema are taken into account.
219 //     Additionally, only the top or the bottom of a contour can match,
220 //     depending on the LATIN_TOP flag.
221 //
222 //     Neutral blue zones should always follow non-neutral blue zones.
223 //
224 //   LATIN_X_HEIGHT
225 //     Scale all glyphs vertically from the corresponding script to make the
226 //     reference line of this blue zone align on the grid.  The scaling
227 //     takes place before all other blue zones get aligned to the grid.
228 //     Only one blue character string of a script style can have this flag.
229 //
230 //   LATIN_LONG
231 //     Apply an additional constraint for blue zone values: Don't
232 //     necessarily use the extremum as-is but a segment of the topmost (or
233 //     bottommost) contour that is longer than a heuristic threshold, and
234 //     which is not too far away vertically from the real extremum.  This
235 //     ensures that small bumps in the outline are ignored (for example, the
236 //     `vertical serifs' found in many Hebrew glyph designs).
237 //
238 //     The segment must be at least EM/25 font units long, and the distance
239 //     to the extremum must be smaller than EM/4.
240 //
241 //
242 // cjk auto-hinter
243 // ---------------
244 //
245 // Characters in a blue string are *not* automatically classified.  Instead,
246 // first come the characters used for the overshoot value, then the
247 // character `|', then the characters used for the reference value.  The
248 // blue zone is then set up by the mean values of all reference values and
249 // all overshoot values, respectively.  Both horizontal and vertical blue
250 // zones (i.e., adjusting vertical and horizontal coordinate values,
251 // respectively) are supported.
252 //
253 // For the cjk auto-hinter, the overshoot should be smaller than the
254 // reference for top zones, and vice versa for bottom zones.
255 //
256 //   CJK_TOP
257 //     Take the maximum flat and round coordinate values of the blue string
258 //     characters.  If not set, take the minimum values.
259 //
260 //   CJK_RIGHT
261 //     A synonym for CJK_TOP.  If CJK_HORIZ is set, this flag indicates the
262 //     right blue zone, taking horizontal maximum values.
263 //
264 //   CJK_HORIZ
265 //     Define a blue zone for horizontal hinting (i.e., vertical blue
266 //     zones).  If not set, this is a blue zone for vertical hinting.
267
268
269 AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
270
271   AF_BLUE_STRINGSET_CYRL
272     { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        }
273     { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM,  0                                 }
274     { AF_BLUE_STRING_CYRILLIC_SMALL,           AF_BLUE_PROPERTY_LATIN_TOP      |
275                                                AF_BLUE_PROPERTY_LATIN_X_HEIGHT   }
276     { AF_BLUE_STRING_CYRILLIC_SMALL,           0                                 }
277     { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0                                 }
278     { AF_BLUE_STRING_MAX,                      0                                 }
279
280   AF_BLUE_STRINGSET_DEVA
281     { AF_BLUE_STRING_DEVANAGARI_TOP,    AF_BLUE_PROPERTY_LATIN_TOP        }
282     { AF_BLUE_STRING_DEVANAGARI_HEAD,   AF_BLUE_PROPERTY_LATIN_TOP        }
283     { AF_BLUE_STRING_DEVANAGARI_BASE,   AF_BLUE_PROPERTY_LATIN_TOP      |
284                                         AF_BLUE_PROPERTY_LATIN_NEUTRAL  |
285                                         AF_BLUE_PROPERTY_LATIN_X_HEIGHT   }
286     { AF_BLUE_STRING_DEVANAGARI_BASE,   0                                 }
287     { AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0                                 }
288     { AF_BLUE_STRING_MAX,               0                                 }
289
290   AF_BLUE_STRINGSET_GREK
291     { AF_BLUE_STRING_GREEK_CAPITAL_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        }
292     { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM,  0                                 }
293     { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP,  AF_BLUE_PROPERTY_LATIN_TOP        }
294     { AF_BLUE_STRING_GREEK_SMALL,           AF_BLUE_PROPERTY_LATIN_TOP      |
295                                             AF_BLUE_PROPERTY_LATIN_X_HEIGHT   }
296     { AF_BLUE_STRING_GREEK_SMALL,           0                                 }
297     { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0                                 }
298     { AF_BLUE_STRING_MAX,                   0                                 }
299
300   AF_BLUE_STRINGSET_HEBR
301     { AF_BLUE_STRING_HEBREW_TOP,       AF_BLUE_PROPERTY_LATIN_TOP  |
302                                        AF_BLUE_PROPERTY_LATIN_LONG   }
303     { AF_BLUE_STRING_HEBREW_BOTTOM,    0                             }
304     { AF_BLUE_STRING_HEBREW_DESCENDER, 0                             }
305     { AF_BLUE_STRING_MAX,              0                             }
306
307   AF_BLUE_STRINGSET_LATN
308     { AF_BLUE_STRING_LATIN_CAPITAL_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        }
309     { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM,  0                                 }
310     { AF_BLUE_STRING_LATIN_SMALL_F_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        }
311     { AF_BLUE_STRING_LATIN_SMALL,           AF_BLUE_PROPERTY_LATIN_TOP      |
312                                             AF_BLUE_PROPERTY_LATIN_X_HEIGHT   }
313     { AF_BLUE_STRING_LATIN_SMALL,           0                                 }
314     { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0                                 }
315     { AF_BLUE_STRING_MAX,                   0                                 }
316
317   AF_BLUE_STRINGSET_TELU
318     { AF_BLUE_STRING_TELUGU_TOP,    AF_BLUE_PROPERTY_LATIN_TOP }
319     { AF_BLUE_STRING_TELUGU_BOTTOM, 0                          }
320     { AF_BLUE_STRING_MAX,           0                          }
321
322 #ifdef AF_CONFIG_OPTION_CJK
323
324   AF_BLUE_STRINGSET_HANI
325     { AF_BLUE_STRING_CJK_TOP,    AF_BLUE_PROPERTY_CJK_TOP     }
326     { AF_BLUE_STRING_CJK_BOTTOM, 0                            }
327 #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
328     { AF_BLUE_STRING_CJK_LEFT,   AF_BLUE_PROPERTY_CJK_HORIZ   }
329     { AF_BLUE_STRING_CJK_RIGHT,  AF_BLUE_PROPERTY_CJK_HORIZ |
330                                  AF_BLUE_PROPERTY_CJK_RIGHT   }
331 #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
332     { AF_BLUE_STRING_MAX,        0                            }
333
334 #endif /* AF_CONFIG_OPTION_CJK                */
335
336
337 // END