diff --git a/drw.c b/drw.c index 8fd1ca4..66acbbe 100644 --- a/drw.c +++ b/drw.c @@ -11,6 +11,8 @@ #define UTF_INVALID 0xFFFD #define UTF_SIZ 4 +int has_libxft_bgra = 0; + static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0}; static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; @@ -139,11 +141,13 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349 * and lots more all over the internet. */ - FcBool iscol; - if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) { - XftFontClose(drw->dpy, xfont); - return NULL; - } + if (!has_libxft_bgra){ + FcBool iscol; + if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) { + XftFontClose(drw->dpy, xfont); + return NULL; + } + } font = ecalloc(1, sizeof(Fnt)); font->xfont = xfont; @@ -174,6 +178,8 @@ drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount) if (!drw || !fonts) return NULL; + has_libxft_bgra = !system("pacman -Q libxft | grep bgra > /dev/null 2> /dev/null"); + for (i = 1; i <= fontcount; i++) { if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) { cur->next = ret;