summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2014-12-14 13:55:53 -0800
committerBehdad Esfahbod <behdad@behdad.org>2014-12-14 13:57:24 -0800
commit66db69a6d991945f96feb1da683a2e04ea396842 (patch)
tree23671061b66a3285c5e633929f0e0b4bdfef6020 /src
parentdbc7c4a2cfe1ba6c537957b3b68b625403ca99fd (diff)
Treat color fonts as scalable
All color fonts are designed to be scaled, even if they only have bitmap strikes. Client is responsible to scale the bitmaps. This is in constrast to non-color strikes... Clients can still use FC_OUTLINE to distinguish bitmap vs outline fonts. Previously FC_OUTLINE and FC_SCALABLE always had the same value. Now FC_SCALABLE is set to (FC_OUTLINE || FC_COLOR). Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=87122
Diffstat (limited to 'src')
-rw-r--r--src/fcfreetype.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index 2575a720..81ebda70 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -1277,20 +1277,29 @@ FcFreeTypeQueryFace (const FT_Face face,
if (!pat)
goto bail0;
- if (!FcPatternAddBool (pat, FC_OUTLINE,
- (face->face_flags & FT_FACE_FLAG_SCALABLE) != 0))
- goto bail1;
+ {
+ int has_outline = !!(face->face_flags & FT_FACE_FLAG_SCALABLE);
+ int has_color = 0;
- if (!FcPatternAddBool (pat, FC_SCALABLE,
- (face->face_flags & FT_FACE_FLAG_SCALABLE) != 0))
- goto bail1;
+#ifdef FT_FACE_FLAG_COLOR
+ has_color = !!(face->face_flags & FT_FACE_FLAG_COLOR);
+#endif
+
+ if (!FcPatternAddBool (pat, FC_OUTLINE, has_outline))
+ goto bail1;
#ifdef FT_FACE_FLAG_COLOR
- if (!FcPatternAddBool (pat, FC_COLOR,
- (face->face_flags & FT_FACE_FLAG_COLOR) != 0))
- goto bail1;
+ if (!FcPatternAddBool (pat, FC_COLOR, has_color))
+ goto bail1;
#endif
+ /* All color fonts are designed to be scaled, even if they only have
+ * bitmap strikes. Client is responsible to scale the bitmaps. This
+ * is in constrast to non-color strikes... */
+ if (!FcPatternAddBool (pat, FC_SCALABLE, has_outline || has_color))
+ goto bail1;
+ }
+
/*
* Get the OS/2 table