diff options
| -rw-r--r-- | etc/NEWS | 6 | ||||
| -rw-r--r-- | src/font.c | 7 | ||||
| -rw-r--r-- | src/ftfont.c | 7 |
3 files changed, 20 insertions, 0 deletions
| @@ -31,6 +31,12 @@ in its NEWS.) | |||
| 31 | 31 | ||
| 32 | * Changes in Emacs 26.2 | 32 | * Changes in Emacs 26.2 |
| 33 | 33 | ||
| 34 | --- | ||
| 35 | ** New variable 'xft-ignore-color-fonts'. | ||
| 36 | Default t means don't try to load color fonts when using Xft, as they | ||
| 37 | often cause crashes. Set it to nil if you really need those fonts. | ||
| 38 | (Bug#30874) | ||
| 39 | |||
| 34 | 40 | ||
| 35 | * Editing Changes in Emacs 26.2 | 41 | * Editing Changes in Emacs 26.2 |
| 36 | 42 | ||
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 | ||