2 |
/* */ |
/* */ |
3 |
/* gxfgen.c */ |
/* gxfgen.c */ |
4 |
/* */ |
/* */ |
5 |
/* Generate feature registry infomations for gxv feat validator. */ |
/* Generate feature registry data for gxv `feat' validator. */ |
6 |
/* This program is derived from gxfeatreg.c in gxlayout. */ |
/* This program is derived from gxfeatreg.c in gxlayout. */ |
7 |
/* */ |
/* */ |
8 |
/* Copyright 2004, 2005 by Masatake YAMATO and Redhat K.K. */ |
/* Copyright 2004, 2005 by Masatake YAMATO and Redhat K.K. */ |
35 |
/***************************************************************************/ |
/***************************************************************************/ |
36 |
|
|
37 |
/***************************************************************************/ |
/***************************************************************************/ |
38 |
/* Development of gxfeatreg.c is support of */ |
/* */ |
39 |
|
/* Development of gxfeatreg.c is supported by */ |
40 |
/* Information-technology Promotion Agency, Japan. */ |
/* Information-technology Promotion Agency, Japan. */ |
41 |
|
/* */ |
42 |
/***************************************************************************/ |
/***************************************************************************/ |
43 |
|
|
44 |
|
|
45 |
/***************************************************************************/ |
/***************************************************************************/ |
46 |
/* */ |
/* */ |
47 |
/* This file is compiled to a standalone executable. */ |
/* This file is compiled as a stand-alone executable. */ |
48 |
/* This file is never compiled into `libfreetype2'. */ |
/* This file is never compiled into `libfreetype2'. */ |
49 |
/* The output of this file is used in `gxvfeat.c'. */ |
/* The output of this file is used in `gxvfeat.c'. */ |
50 |
/* ----------------------------------------------------------------------- */ |
/* ----------------------------------------------------------------------- */ |
53 |
/* */ |
/* */ |
54 |
/***************************************************************************/ |
/***************************************************************************/ |
55 |
|
|
56 |
/***************************************************************************/ |
/*******************************************************************/ |
57 |
/* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING */ |
/* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING */ |
58 |
/***************************************************************************/ |
/*******************************************************************/ |
59 |
|
|
60 |
/* |
/* |
61 |
* If you add a new setting to a feature, check the number of setting |
* If you add a new setting to a feature, check the number of settings |
62 |
* in the feature. If the number is greater than value defined as |
* in the feature. If the number is greater than the value defined as |
63 |
* FEATREG_MAX_SETTING, update the value. |
* FEATREG_MAX_SETTING, update the value. |
64 |
*/ |
*/ |
65 |
#define FEATREG_MAX_SETTING 12 |
#define FEATREG_MAX_SETTING 12 |
66 |
/***************************************************************************/ |
|
67 |
/* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING */ |
/*******************************************************************/ |
68 |
/***************************************************************************/ |
/* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING */ |
69 |
|
/*******************************************************************/ |
70 |
|
|
71 |
|
|
72 |
#include <stdio.h> |
#include <stdio.h> |
73 |
#include <string.h> |
#include <string.h> |
74 |
|
|
75 |
|
|
76 |
/*************************************************************************/ |
/*************************************************************************/ |
77 |
/*************************************************************************/ |
/*************************************************************************/ |
78 |
/***** *****/ |
/***** *****/ |
81 |
/*************************************************************************/ |
/*************************************************************************/ |
82 |
/*************************************************************************/ |
/*************************************************************************/ |
83 |
|
|
|
|
|
84 |
#define APPLE_RESERVED "Apple Reserved" |
#define APPLE_RESERVED "Apple Reserved" |
85 |
#define APPLE_RESERVED_LENGTH 14 |
#define APPLE_RESERVED_LENGTH 14 |
86 |
|
|
88 |
{ |
{ |
89 |
const char* feat_name; |
const char* feat_name; |
90 |
char exclusive; |
char exclusive; |
91 |
char* setting_name [FEATREG_MAX_SETTING]; |
char* setting_name[FEATREG_MAX_SETTING]; |
92 |
|
|
93 |
} GX_Feature_RegistryRec; |
} GX_Feature_RegistryRec; |
94 |
|
|
95 |
|
|
96 |
#define EMPTYFEAT {0, 0, {NULL}} |
#define EMPTYFEAT {0, 0, {NULL}} |
97 |
static GX_Feature_RegistryRec featreg_table [] = { |
|
98 |
{ /* 0 */ |
|
99 |
|
static GX_Feature_RegistryRec featreg_table[] = { |
100 |
|
{ /* 0 */ |
101 |
"All Typographic Features", |
"All Typographic Features", |
102 |
0, |
0, |
103 |
{ |
{ |
302 |
"Traditional Characters, Alternative Set 4", |
"Traditional Characters, Alternative Set 4", |
303 |
"Traditional Characters, Alternative Set 5", |
"Traditional Characters, Alternative Set 5", |
304 |
"Expert Characters", |
"Expert Characters", |
305 |
NULL /* count=>12 */ |
NULL /* count => 12 */ |
306 |
} |
} |
307 |
}, { /* 21 */ |
}, { /* 21 */ |
308 |
"Number Case", |
"Number Case", |
369 |
"Proportional", |
"Proportional", |
370 |
NULL |
NULL |
371 |
} |
} |
372 |
}, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 27-30 */ |
}, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 27-30 */ |
373 |
EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 31-35 */ |
EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 31-35 */ |
374 |
EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 36-40 */ |
EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 36-40 */ |
375 |
EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 40-45 */ |
EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 40-45 */ |
383 |
EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 81-85 */ |
EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 81-85 */ |
384 |
EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 86-90 */ |
EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 86-90 */ |
385 |
EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 91-95 */ |
EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 91-95 */ |
386 |
EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 96-98 */ |
EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 96-98 */ |
387 |
EMPTYFEAT, /* 99 */ { /* 100 => 22*/ |
EMPTYFEAT, /* 99 */ { /* 100 => 22 */ |
388 |
"Text Spacing", |
"Text Spacing", |
389 |
1, |
1, |
390 |
{ |
{ |
431 |
}; |
}; |
432 |
|
|
433 |
|
|
|
|
|
434 |
/*************************************************************************/ |
/*************************************************************************/ |
435 |
/*************************************************************************/ |
/*************************************************************************/ |
436 |
/***** *****/ |
/***** *****/ |
455 |
const char* feat_name; |
const char* feat_name; |
456 |
int nSettings; |
int nSettings; |
457 |
|
|
458 |
feat_name = featreg_table[i].feat_name; |
|
459 |
|
feat_name = featreg_table[i].feat_name; |
460 |
for ( nSettings = 0; |
for ( nSettings = 0; |
461 |
featreg_table[i].setting_name[nSettings]; |
featreg_table[i].setting_name[nSettings]; |
462 |
nSettings++) |
nSettings++) |
463 |
0; /* Do nothing */ |
; /* Do nothing */ |
464 |
|
|
465 |
printf( " {%1d, %1d, %1d, %2d}, /* %s */\n", |
printf( " {%1d, %1d, %1d, %2d}, /* %s */\n", |
466 |
feat_name ? 1 : 0, |
feat_name ? 1 : 0, |
467 |
( feat_name && |
( feat_name && |
468 |
( strncmp( feat_name, APPLE_RESERVED, APPLE_RESERVED_LENGTH ) == 0 ) |
( strncmp( feat_name, |
469 |
|
APPLE_RESERVED, APPLE_RESERVED_LENGTH ) == 0 ) |
470 |
) ? 1 : 0, |
) ? 1 : 0, |
471 |
featreg_table[i].exclusive ? 1 : 0, |
featreg_table[i].exclusive ? 1 : 0, |
472 |
nSettings, |
nSettings, |
478 |
return 0; |
return 0; |
479 |
} |
} |
480 |
|
|
481 |
|
|
482 |
/* END */ |
/* END */ |