1 /***************************************************************************/
5 /* Generate feature registry data for gxv `feat' validator. */
6 /* This program is derived from gxfeatreg.c in gxlayout. */
8 /* Copyright 2004, 2005, 2006 by Masatake YAMATO and Redhat K.K. */
10 /* This file may only be used, */
11 /* modified, and distributed under the terms of the FreeType project */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */
16 /***************************************************************************/
18 /***************************************************************************/
22 /* Database of font features pre-defined by Apple Computer, Inc. */
23 /* http://developer.apple.com/fonts/Registry/ */
26 /* Copyright 2003 by */
27 /* Masatake YAMATO and Redhat K.K. */
29 /* This file may only be used, */
30 /* modified, and distributed under the terms of the FreeType project */
31 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
32 /* this file you indicate that you have read the license and */
33 /* understand and accept it fully. */
35 /***************************************************************************/
37 /***************************************************************************/
39 /* Development of gxfeatreg.c is supported by */
40 /* Information-technology Promotion Agency, Japan. */
42 /***************************************************************************/
45 /***************************************************************************/
47 /* This file is compiled as a stand-alone executable. */
48 /* This file is never compiled into `libfreetype2'. */
49 /* The output of this file is used in `gxvfeat.c'. */
50 /* ----------------------------------------------------------------------- */
51 /* Compile: gcc `pkg-config --cflags freetype2` gxvfgen.c -o gxvfgen */
52 /* Run: ./gxvfgen > tmp.c */
54 /***************************************************************************/
56 /*******************************************************************/
57 /* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING */
58 /*******************************************************************/
61 * If you add a new setting to a feature, check the number of settings
62 * in the feature. If the number is greater than the value defined as
63 * FEATREG_MAX_SETTING, update the value.
65 #define FEATREG_MAX_SETTING 12
67 /*******************************************************************/
68 /* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING */
69 /*******************************************************************/
76 /*************************************************************************/
77 /*************************************************************************/
79 /***** Data and Types *****/
81 /*************************************************************************/
82 /*************************************************************************/
84 #define APPLE_RESERVED "Apple Reserved"
85 #define APPLE_RESERVED_LENGTH 14
87 typedef struct GX_Feature_RegistryRec_
89 const char* feat_name
;
91 char* setting_name
[FEATREG_MAX_SETTING
];
93 } GX_Feature_RegistryRec
;
96 #define EMPTYFEAT {0, 0, {NULL}}
99 static GX_Feature_RegistryRec featreg_table
[] = {
101 "All Typographic Features",
111 "Required Ligatures",
116 "Diphthong Ligatures",
118 "Squared Ligatures, Abbreviated",
122 "Cursive Connection",
126 "Partially Connected",
134 "Upper & Lower Case",
139 "Initial Caps & Small Caps",
143 "Vertical Substitution",
146 /* "Substitute Vertical Forms", */
147 "Turns on the feature",
151 "Linguistic Rearrangement",
154 /* "Linguistic Rearrangement", */
155 "Turns on the feature",
162 "Monospaced Numbers",
163 "Proportional Numbers",
174 "Word Initial Swashes",
175 "Word Final Swashes",
176 "Line Initial Swashes",
177 "Line Final Swashes",
187 "Decompose Diacritics",
194 /* "Normal Position", */
195 "No Vertical Position",
206 "Vertical Fractions",
207 "Diagonal Fractions",
215 "Overlapping Characters",
218 /* "Prevent Overlap", */
219 "Turns on the feature",
223 "Typographic Extras",
226 "Hyphens to Em Dash",
227 "Hyphens to En Dash",
231 "Periods to Ellipsis",
235 "Mathematical Extras",
239 "Asterisk to Multiply",
241 "Inequality Ligatures",
253 "Decorative Borders",
254 "International Symbols",
259 "Character Alternatives",
294 "Traditional Characters",
295 "Simplified Characters",
296 "JIS 1978 Characters",
297 "JIS 1983 Characters",
298 "JIS 1990 Characters",
299 "Traditional Characters, Alternative Set 1",
300 "Traditional Characters, Alternative Set 2",
301 "Traditional Characters, Alternative Set 3",
302 "Traditional Characters, Alternative Set 4",
303 "Traditional Characters, Alternative Set 5",
305 NULL
/* count => 12 */
311 "Lower Case Numbers",
312 "Upper Case Numbers",
325 }, /* Here after Newer */ { /* 23 */
329 "No Transliteration",
331 "Hiragana to Katakana",
332 "Katakana to Hiragana",
333 "Kana to Romanization",
334 "Romanization to Hiragana",
335 "Romanization to Katakana",
336 "Hanja to Hangul, Alternative Set 1",
337 "Hanja to Hangul, Alternative Set 2",
338 "Hanja to Hangul, Alternative Set 3",
347 "Rounded Box Annotation",
349 "Inverted Circle Annotation",
350 "Parenthesis Annotation",
352 "Roman Numeral Annotation",
353 "Diamond Annotation",
365 "Ideographic Spacing",
372 }, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, /* 27-30 */
373 EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, /* 31-35 */
374 EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, /* 36-40 */
375 EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, /* 40-45 */
376 EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, /* 46-50 */
377 EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, /* 51-55 */
378 EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, /* 56-60 */
379 EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, /* 61-65 */
380 EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, /* 66-70 */
381 EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, /* 71-75 */
382 EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, /* 76-80 */
383 EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, /* 81-85 */
384 EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, /* 86-90 */
385 EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, /* 91-95 */
386 EMPTYFEAT
, EMPTYFEAT
, EMPTYFEAT
, /* 96-98 */
387 EMPTYFEAT
, /* 99 */ { /* 100 => 22 */
406 "Ideographic Spacing",
424 "All Typographic Features",
434 /*************************************************************************/
435 /*************************************************************************/
437 /***** Generator *****/
439 /*************************************************************************/
440 /*************************************************************************/
449 printf( " /* Generated from %s */\n", __FILE__
);
452 i
< sizeof ( featreg_table
) / sizeof ( GX_Feature_RegistryRec
);
455 const char* feat_name
;
459 feat_name
= featreg_table
[i
].feat_name
;
461 featreg_table
[i
].setting_name
[nSettings
];
465 printf( " {%1d, %1d, %1d, %2d}, /* %s */\n",
468 ( ft_strncmp( feat_name
,
469 APPLE_RESERVED
, APPLE_RESERVED_LENGTH
) == 0 )
471 featreg_table
[i
].exclusive
? 1 : 0,
473 feat_name
? feat_name
: "__EMPTY__" );