diff options
| author | Robert Pluim | 2018-04-03 11:06:01 +0200 |
|---|---|---|
| committer | Robert Pluim | 2018-06-05 14:08:08 +0200 |
| commit | f21fa142aca53e3de5783e1ce6fe1bf116174aeb (patch) | |
| tree | abf916233ec6c14b7993be6a563dbb72a024bf3f /src | |
| parent | 55c9bb9f3c2971e347caeea1402f97fb603c4210 (diff) | |
| download | emacs-f21fa142aca53e3de5783e1ce6fe1bf116174aeb.tar.gz emacs-f21fa142aca53e3de5783e1ce6fe1bf116174aeb.zip | |
Ignore color fonts when using Xft
* src/font.c (syms_of_font): New configuration variable
xft-ignore-color-fonts, default t.
* src/ftfont.c (ftfont_spec_pattern): Tell fontconfig to ignore
color fonts if xft-ignore-color-fonts is t. (Bug#30874, Bug#30045)
* etc/NEWS: Document xft-ignore-color-fonts.
Diffstat (limited to 'src')
| -rw-r--r-- | src/font.c | 7 | ||||
| -rw-r--r-- | src/ftfont.c | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/font.c b/src/font.c index e53935a15cc..305bb14576a 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -5476,6 +5476,13 @@ Disabling compaction of font caches might enlarge the Emacs memory | |||
| 5476 | footprint in sessions that use lots of different fonts. */); | 5476 | footprint in sessions that use lots of different fonts. */); |
| 5477 | inhibit_compacting_font_caches = 0; | 5477 | inhibit_compacting_font_caches = 0; |
| 5478 | 5478 | ||
| 5479 | DEFVAR_BOOL ("xft-ignore-color-fonts", | ||
| 5480 | Vxft_ignore_color_fonts, | ||
| 5481 | doc: /* | ||
| 5482 | Non-nil means don't query fontconfig for color fonts, since they often | ||
| 5483 | cause Xft crashes. Only has an effect in Xft builds. */); | ||
| 5484 | Vxft_ignore_color_fonts = 1; | ||
| 5485 | |||
| 5479 | #ifdef HAVE_WINDOW_SYSTEM | 5486 | #ifdef HAVE_WINDOW_SYSTEM |
| 5480 | #ifdef HAVE_FREETYPE | 5487 | #ifdef HAVE_FREETYPE |
| 5481 | syms_of_ftfont (); | 5488 | syms_of_ftfont (); |
diff --git a/src/ftfont.c b/src/ftfont.c index c2e093e633d..24a92dd52e8 100644 --- a/src/ftfont.c +++ b/src/ftfont.c | |||
| @@ -764,6 +764,13 @@ ftfont_spec_pattern (Lisp_Object spec, char *otlayout, struct OpenTypeSpec **ots | |||
| 764 | if (scalable >= 0 | 764 | if (scalable >= 0 |
| 765 | && ! FcPatternAddBool (pattern, FC_SCALABLE, scalable ? FcTrue : FcFalse)) | 765 | && ! FcPatternAddBool (pattern, FC_SCALABLE, scalable ? FcTrue : FcFalse)) |
| 766 | goto err; | 766 | goto err; |
| 767 | #ifdef HAVE_XFT | ||
| 768 | /* We really don't like color fonts, they cause Xft crashes. See | ||
| 769 | Bug#30874. */ | ||
| 770 | if (Vxft_ignore_color_fonts | ||
| 771 | && ! FcPatternAddBool(pattern, FC_COLOR, FcFalse)) | ||
| 772 | goto err; | ||
| 773 | #endif | ||
| 767 | 774 | ||
| 768 | goto finish; | 775 | goto finish; |
| 769 | 776 | ||