summaryrefslogtreecommitdiff
path: root/src/xftfreetype.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xftfreetype.c')
-rw-r--r--src/xftfreetype.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/xftfreetype.c b/src/xftfreetype.c
index 4bba26b..51d4613 100644
--- a/src/xftfreetype.c
+++ b/src/xftfreetype.c
@@ -524,7 +524,7 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
/*
* Compute glyph load flags
*/
- fi->load_flags = FT_LOAD_DEFAULT;
+ fi->load_flags = FT_LOAD_DEFAULT | FT_LOAD_COLOR;
#ifndef XFT_EMBEDDED_BITMAP
#define XFT_EMBEDDED_BITMAP "embeddedbitmap"
@@ -776,6 +776,7 @@ XftFontOpenInfo (Display *dpy,
FcChar32 hash_value;
FcChar32 rehash_value;
FcBool antialias;
+ FcBool color;
int max_glyph_memory;
size_t alloc_size;
int ascent, descent, height;
@@ -832,12 +833,18 @@ XftFontOpenInfo (Display *dpy,
if (!(face->face_flags & FT_FACE_FLAG_SCALABLE))
antialias = FcFalse;
+ color = FT_HAS_COLOR(face) ? FcTrue : FcFalse;
+
/*
* Find the appropriate picture format
*/
if (fi->render)
{
- if (antialias)
+ if (color)
+ {
+ format = XRenderFindStandardFormat (dpy, PictStandardARGB32);
+ }
+ else if (antialias)
{
switch (fi->rgba) {
case FC_RGBA_RGB:
@@ -968,6 +975,13 @@ XftFontOpenInfo (Display *dpy,
* which doesn't happen in XftFontInfoFill
*/
font->info.antialias = antialias;
+
+ /*
+ * Set color value, which is only known once the
+ * font was loaded
+ */
+ font->info.color = color;
+
/*
* bump XftFile reference count
*/