Subject: bug#40097: 28.0.50; Preferred font ignored for specific charset

From: Robert Pluim <[email-masked]>
Date: Wed, 18 Mar 2020 21:47:19 +0100

>>>>> On Wed, 18 Mar 2020 20:18:11 +0200, Eli Zaretskii <[email-masked]> said:

    >> From: Robert Pluim <[email-masked]>
    >> Cc: [email-masked],  [email-masked],  [email-masked]
    >> Date: Wed, 18 Mar 2020 17:28:47 +0100
    >> 
    >> ftfont.c:
    >> 
    >> { "windows-1251", { 0x0401, 0x0490 }, "ru"},
    >> 
    >> Thread 1 "emacs" hit Breakpoint 3, ftfont_get_charset (registry=XIL(0x394540)) at ftfont.c:486
    >> 486	  for (i = j = 0; i < SBYTES (SYMBOL_NAME (registry)); i++, j++)
    >> (gdb) pp registry
    >> microsoft-cp1251
    >> (gdb) 
    >> 
    >> So correcting the name of the registry in ftfont.c fixes this.

    Eli> You mean, fixing that makes DejaVu Sans Mono be used in this case?

Yes.

    Eli> That's great, let's fix this in emacs-27 then.

If you want me to be conservative, I could *add* a microsoft-cp1251
entry instead of replacing windows-1251, but as far as I know
windows-1251 is not a valid registry name.

>From c0001bb3cd097809f152fe9ca985aa319a957678 Mon Sep 17 00:00:00 2001
From: Robert Pluim <[email-masked]>
Date: Wed, 18 Mar 2020 21:37:55 +0100
Subject: [PATCH] Use correct registry name for windows-1251 charset
To: [email-masked]

* src/ftfont.c (fc_charset_table): The registry to use to lookup
windows-1251 charset is microsoft-cp1251, not windows-1251.
(Bug#40097)
---
 src/ftfont.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ftfont.c b/src/ftfont.c
index 2b442ead4b..6b549c3ddf 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -119,7 +119,7 @@ #define SYMBOL_FcChar8(SYM) (FcChar8 *) SDATA (SYMBOL_NAME (SYM))
     { "jisx0213.2004-1", { 0x20B9F }},
     { "viscii1.1-1", { 0x1EA0, 0x1EAE, 0x1ED2 }, "vi"},
     { "tis620.2529-1", { 0x0E01 }, "th"},
-    { "windows-1251", { 0x0401, 0x0490 }, "ru"},
+    { "microsoft-cp1251", { 0x0401, 0x0490 }, "ru"},
     { "koi8-r", { 0x0401, 0x2219 }, "ru"},
     { "mulelao-1", { 0x0E81 }, "lo"},
     { "unicode-sip", { 0x20000 }},
-- 
2.19.1.816.gcd69ec8cde