aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobert Pluim2019-12-29 20:08:38 +0100
committerRobert Pluim2019-12-29 20:08:38 +0100
commit732dcfc85078dafb4b5983de3cadb7a65329dc47 (patch)
treefed4178946edb7b7e35ac95170fa1b32b6cfdc8c /src
parentaa0c679f484347d20ab6f7c0f75f32f5e360cb89 (diff)
downloademacs-732dcfc85078dafb4b5983de3cadb7a65329dc47.tar.gz
emacs-732dcfc85078dafb4b5983de3cadb7a65329dc47.zip
Ignore all color fonts when using XFT
* etc/NEWS: Announce change to matching color fonts when using XFT. * src/ftfont.c (ftfont_list) [HAVE_XFT && FC_COLOR]: Query for the color attribute of the matched font, and skip it if it is not FcFalse (Bug#37786).
Diffstat (limited to 'src')
-rw-r--r--src/ftfont.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ftfont.c b/src/ftfont.c
index b8199dc4ba7..5bc048c3003 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -865,6 +865,9 @@ ftfont_list (struct frame *f, Lisp_Object spec)
865#ifdef FC_FONTFORMAT 865#ifdef FC_FONTFORMAT
866 FC_FONTFORMAT, 866 FC_FONTFORMAT,
867#endif 867#endif
868#if defined HAVE_XFT && defined FC_COLOR
869 FC_COLOR,
870#endif
868 NULL); 871 NULL);
869 if (! objset) 872 if (! objset)
870 goto err; 873 goto err;
@@ -904,7 +907,19 @@ ftfont_list (struct frame *f, Lisp_Object spec)
904 for (i = 0; i < fontset->nfont; i++) 907 for (i = 0; i < fontset->nfont; i++)
905 { 908 {
906 Lisp_Object entity; 909 Lisp_Object entity;
907 910#if defined HAVE_XFT && defined FC_COLOR
911 {
912 /* Some fonts, notably NotoColorEmoji, have an FC_COLOR value
913 that's neither FcTrue nor FcFalse, which means FcFontList
914 returns them even when it shouldn't really do so, so we
915 need to manually skip them here (Bug#37786). */
916 FcBool b;
917 if (Vxft_ignore_color_fonts
918 && FcPatternGetBool (fontset->fonts[i], FC_COLOR, 0, &b)
919 == FcResultMatch && b != FcFalse)
920 continue;
921 }
922#endif
908 if (spacing >= 0) 923 if (spacing >= 0)
909 { 924 {
910 int this; 925 int this;