Add FC_COLOR

Only adds "color" to pattern if FreeType version supports color.

Based on patch from Jungshik Shin.
This commit is contained in:
Behdad Esfahbod 2014-12-14 13:39:41 -08:00
parent fc7e1a9497
commit dbc7c4a2cf
5 changed files with 10 additions and 0 deletions

View File

@ -176,6 +176,7 @@ convenience for the application's rendering mechanism.
scalable FC_SCALABLE Bool Whether glyphs can be scaled
scale FC_SCALE Double Scale factor for point->pixel
conversions
color FC_COLOR Bool Whether any glyphs have color
dpi FC_DPI Double Target dots per inch
rgba FC_RGBA Int unknown, rgb, bgr, vrgb,
vbgr, none - subpixel geometry

View File

@ -94,6 +94,7 @@ typedef int FcBool;
#define FC_RASTERIZER "rasterizer" /* String (deprecated) */
#define FC_OUTLINE "outline" /* Bool */
#define FC_SCALABLE "scalable" /* Bool */
#define FC_COLOR "color" /* Bool */
#define FC_SCALE "scale" /* double */
#define FC_DPI "dpi" /* double */
#define FC_RGBA "rgba" /* Int */

View File

@ -1285,6 +1285,12 @@ FcFreeTypeQueryFace (const FT_Face face,
(face->face_flags & FT_FACE_FLAG_SCALABLE) != 0))
goto bail1;
#ifdef FT_FACE_FLAG_COLOR
if (!FcPatternAddBool (pat, FC_COLOR,
(face->face_flags & FT_FACE_FLAG_COLOR) != 0))
goto bail1;
#endif
/*
* Get the OS/2 table

View File

@ -284,6 +284,7 @@ typedef enum _FcMatcherPriority {
PRI1(FILE),
PRI1(FONTFORMAT),
PRI1(SCALABLE),
PRI1(COLOR),
PRI1(FOUNDRY),
PRI1(CHARSET),
PRI_FAMILY_STRONG,

View File

@ -68,4 +68,5 @@ FC_OBJECT (FONT_FEATURES, FcTypeString, NULL)
FC_OBJECT (PRGNAME, FcTypeString, NULL)
FC_OBJECT (HASH, FcTypeString, NULL) /* deprecated */
FC_OBJECT (POSTSCRIPT_NAME, FcTypeString, FcComparePostScript)
FC_OBJECT (COLOR, FcTypeBool, FcCompareBool)
/* ^-------------- Add new objects here. */