1 /****************************************************************************
5 * Generate feature registry data for gxv `feat' validator.
6 * This program is derived from gxfeatreg.c in gxlayout.
8 * Copyright (C) 2004-2023 by
9 * Masatake YAMATO and Redhat K.K.
11 * This file may only be used,
12 * modified, and distributed under the terms of the FreeType project
13 * license, LICENSE.TXT. By continuing to use, modify, or distribute
14 * this file you indicate that you have read the license and
15 * understand and accept it fully.
19 /****************************************************************************
23 * Database of font features pre-defined by Apple Computer, Inc.
24 * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM09/AppendixF.html
28 * Masatake YAMATO and Redhat K.K.
30 * This file may only be used,
31 * modified, and distributed under the terms of the FreeType project
32 * license, LICENSE.TXT. By continuing to use, modify, or distribute
33 * this file you indicate that you have read the license and
34 * understand and accept it fully.
38 /****************************************************************************
40 * Development of gxfeatreg.c is supported by
41 * Information-technology Promotion Agency, Japan.
46 /****************************************************************************
48 * This file is compiled as a stand-alone executable.
49 * This file is never compiled into `libfreetype2'.
50 * The output of this file is used in `gxvfeat.c'.
51 * -----------------------------------------------------------------------
52 * Compile: gcc `pkg-config --cflags freetype2` gxvfgen.c -o gxvfgen
53 * Run: ./gxvfgen > tmp.c
57 /********************************************************************
58 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
62 * If you add a new setting to a feature, check the number of settings
63 * in the feature. If the number is greater than the value defined as
64 * FEATREG_MAX_SETTING, update the value.
66 #define FEATREG_MAX_SETTING 12
68 /********************************************************************
69 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
77 /*************************************************************************/
78 /*************************************************************************/
80 /***** Data and Types *****/
82 /*************************************************************************/
83 /*************************************************************************/
85 #define APPLE_RESERVED "Apple Reserved"
86 #define APPLE_RESERVED_LENGTH 14
88 typedef struct GX_Feature_RegistryRec_
90 const char* feat_name;
92 char* setting_name[FEATREG_MAX_SETTING];
94 } GX_Feature_RegistryRec;
97 #define EMPTYFEAT {0, 0, {NULL}}
100 static GX_Feature_RegistryRec featreg_table[] =
103 "All Typographic Features",
113 "Required Ligatures",
118 "Diphthong Ligatures",
120 "Squared Ligatures, Abbreviated",
124 "Cursive Connection",
128 "Partially Connected",
136 "Upper & Lower Case",
141 "Initial Caps & Small Caps",
145 "Vertical Substitution",
148 /* "Substitute Vertical Forms", */
149 "Turns on the feature",
153 "Linguistic Rearrangement",
156 /* "Linguistic Rearrangement", */
157 "Turns on the feature",
164 "Monospaced Numbers",
165 "Proportional Numbers",
176 "Word Initial Swashes",
177 "Word Final Swashes",
178 "Line Initial Swashes",
179 "Line Final Swashes",
189 "Decompose Diacritics",
196 /* "Normal Position", */
197 "No Vertical Position",
208 "Vertical Fractions",
209 "Diagonal Fractions",
217 "Overlapping Characters",
220 /* "Prevent Overlap", */
221 "Turns on the feature",
225 "Typographic Extras",
228 "Hyphens to Em Dash",
229 "Hyphens to En Dash",
233 "Periods to Ellipsis",
237 "Mathematical Extras",
241 "Asterisk to Multiply",
243 "Inequality Ligatures",
255 "Decorative Borders",
256 "International Symbols",
261 "Character Alternatives",
296 "Traditional Characters",
297 "Simplified Characters",
298 "JIS 1978 Characters",
299 "JIS 1983 Characters",
300 "JIS 1990 Characters",
301 "Traditional Characters, Alternative Set 1",
302 "Traditional Characters, Alternative Set 2",
303 "Traditional Characters, Alternative Set 3",
304 "Traditional Characters, Alternative Set 4",
305 "Traditional Characters, Alternative Set 5",
307 NULL /* count => 12 */
313 "Lower Case Numbers",
314 "Upper Case Numbers",
327 }, /* Here after Newer */ { /* 23 */
331 "No Transliteration",
333 "Hiragana to Katakana",
334 "Katakana to Hiragana",
335 "Kana to Romanization",
336 "Romanization to Hiragana",
337 "Romanization to Katakana",
338 "Hanja to Hangul, Alternative Set 1",
339 "Hanja to Hangul, Alternative Set 2",
340 "Hanja to Hangul, Alternative Set 3",
349 "Rounded Box Annotation",
351 "Inverted Circle Annotation",
352 "Parenthesis Annotation",
354 "Roman Numeral Annotation",
355 "Diamond Annotation",
367 "Ideographic Spacing",
374 }, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 27-30 */
375 EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 31-35 */
376 EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 36-40 */
377 EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 40-45 */
378 EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 46-50 */
379 EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 51-55 */
380 EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 56-60 */
381 EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 61-65 */
382 EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 66-70 */
383 EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 71-75 */
384 EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 76-80 */
385 EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 81-85 */
386 EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 86-90 */
387 EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 91-95 */
388 EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 96-98 */
389 EMPTYFEAT, /* 99 */ { /* 100 => 22 */
408 "Ideographic Spacing",
426 "All Typographic Features",
436 /*************************************************************************/
437 /*************************************************************************/
439 /***** Generator *****/
441 /*************************************************************************/
442 /*************************************************************************/
451 printf( " /* Generated from %s */\n", __FILE__ );
454 i < sizeof ( featreg_table ) / sizeof ( GX_Feature_RegistryRec );
457 const char* feat_name;
461 feat_name = featreg_table[i].feat_name;
463 featreg_table[i].setting_name[nSettings];
467 printf( " {%1d, %1d, %1d, %2d}, /* %s */\n",
470 ( ft_strncmp( feat_name,
471 APPLE_RESERVED, APPLE_RESERVED_LENGTH ) == 0 )
473 featreg_table[i].exclusive ? 1 : 0,
475 feat_name ? feat_name : "__EMPTY__" );