diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2014-12-14 13:39:41 -0800 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2014-12-14 13:40:02 -0800 |
commit | dbc7c4a2cfe1ba6c537957b3b68b625403ca99fd (patch) | |
tree | afedfdfd9ebf3e710d116ffa9fa260ce90acd5a0 | |
parent | fc7e1a9497919c88d790d9395eb01cd7d5121507 (diff) |
Add FC_COLOR
Only adds "color" to pattern if FreeType version supports color.
Based on patch from Jungshik Shin.
-rw-r--r-- | doc/fontconfig-devel.sgml | 1 | ||||
-rw-r--r-- | fontconfig/fontconfig.h | 1 | ||||
-rw-r--r-- | src/fcfreetype.c | 6 | ||||
-rw-r--r-- | src/fcmatch.c | 1 | ||||
-rw-r--r-- | src/fcobjs.h | 1 |
5 files changed, 10 insertions, 0 deletions
diff --git a/doc/fontconfig-devel.sgml b/doc/fontconfig-devel.sgml index 2b1122f1..9f3613aa 100644 --- a/doc/fontconfig-devel.sgml +++ b/doc/fontconfig-devel.sgml @@ -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 diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h index afc917c6..85cdd6df 100644 --- a/fontconfig/fontconfig.h +++ b/fontconfig/fontconfig.h @@ -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 */ diff --git a/src/fcfreetype.c b/src/fcfreetype.c index da66741c..2575a720 100644 --- a/src/fcfreetype.c +++ b/src/fcfreetype.c @@ -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 diff --git a/src/fcmatch.c b/src/fcmatch.c index 25081e2c..46d08bcc 100644 --- a/src/fcmatch.c +++ b/src/fcmatch.c @@ -284,6 +284,7 @@ typedef enum _FcMatcherPriority { PRI1(FILE), PRI1(FONTFORMAT), PRI1(SCALABLE), + PRI1(COLOR), PRI1(FOUNDRY), PRI1(CHARSET), PRI_FAMILY_STRONG, diff --git a/src/fcobjs.h b/src/fcobjs.h index bfdf4b58..573fa610 100644 --- a/src/fcobjs.h +++ b/src/fcobjs.h @@ -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. */ |