[varfonts] Add FC_VARIABLE

For now, we mark all fonts as non-variable.
This commit is contained in:
Behdad Esfahbod 2017-09-12 12:21:05 -04:00
parent 80e155c1c0
commit 819d3a5541
5 changed files with 7 additions and 0 deletions

View File

@ -99,6 +99,7 @@ typedef int FcBool;
#define FC_OUTLINE "outline" /* Bool */ #define FC_OUTLINE "outline" /* Bool */
#define FC_SCALABLE "scalable" /* Bool */ #define FC_SCALABLE "scalable" /* Bool */
#define FC_COLOR "color" /* Bool */ #define FC_COLOR "color" /* Bool */
#define FC_VARIABLE "variable" /* Bool */
#define FC_SCALE "scale" /* double (deprecated) */ #define FC_SCALE "scale" /* double (deprecated) */
#define FC_SYMBOL "symbol" /* Bool */ #define FC_SYMBOL "symbol" /* Bool */
#define FC_DPI "dpi" /* double */ #define FC_DPI "dpi" /* double */

View File

@ -39,6 +39,7 @@ static const struct {
{ FC_EMBEDDED_BITMAP_OBJECT, FcTrue }, /* !FC_LOAD_NO_BITMAP */ { FC_EMBEDDED_BITMAP_OBJECT, FcTrue }, /* !FC_LOAD_NO_BITMAP */
{ FC_DECORATIVE_OBJECT, FcFalse }, { FC_DECORATIVE_OBJECT, FcFalse },
{ FC_SYMBOL_OBJECT, FcFalse }, { FC_SYMBOL_OBJECT, FcFalse },
{ FC_VARIABLE_OBJECT, FcFalse },
}; };
#define NUM_FC_BOOL_DEFAULTS (int) (sizeof FcBoolDefaults / sizeof FcBoolDefaults[0]) #define NUM_FC_BOOL_DEFAULTS (int) (sizeof FcBoolDefaults / sizeof FcBoolDefaults[0])

View File

@ -1236,6 +1236,9 @@ FcFreeTypeQueryFace (const FT_Face face,
goto bail1; goto bail1;
} }
if (!FcPatternAddBool (pat, FC_VARIABLE, FcFalse))
goto bail1;
if (id >> 16) if (id >> 16)
{ {
unsigned int instance_id = (id >> 16) - 1; unsigned int instance_id = (id >> 16) - 1;

View File

@ -250,6 +250,7 @@ typedef enum _FcMatcherPriorityDummy {
typedef enum _FcMatcherPriority { typedef enum _FcMatcherPriority {
PRI1(FILE), PRI1(FILE),
PRI1(FONTFORMAT), PRI1(FONTFORMAT),
PRI1(VARIABLE),
PRI1(SCALABLE), PRI1(SCALABLE),
PRI1(COLOR), PRI1(COLOR),
PRI1(FOUNDRY), PRI1(FOUNDRY),

View File

@ -71,4 +71,5 @@ FC_OBJECT (POSTSCRIPT_NAME, FcTypeString, FcComparePostScript)
FC_OBJECT (COLOR, FcTypeBool, FcCompareBool) FC_OBJECT (COLOR, FcTypeBool, FcCompareBool)
FC_OBJECT (SYMBOL, FcTypeBool, FcCompareBool) FC_OBJECT (SYMBOL, FcTypeBool, FcCompareBool)
FC_OBJECT (FONT_VARIATIONS, FcTypeString, NULL) FC_OBJECT (FONT_VARIATIONS, FcTypeString, NULL)
FC_OBJECT (VARIABLE, FcTypeBool, FcCompareBool)
/* ^-------------- Add new objects here. */ /* ^-------------- Add new objects here. */