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

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

>>>>> On Wed, 18 Mar 2020 16:29:23 +0200, Eli Zaretskii <[email-masked]> said:

    Eli> Indeed; and you will see in ftfont.c that ftfont_list (or, rather, one
    Eli> of the subroutines it calls) concocts a "charset" by using the few
    Eli> representative characters from fc_charset_table, and then asks
    Eli> Fontconfig to list fonts which support those characters (at least
    Eli> that's my reading of the code).  Which is why I'm puzzled how come
    Eli> DejaVu Sans Mono is not in the list and we proceed to the xfont
    Eli> backend, because I'm quite sure DejaVu Sans does support the Cyrillic
    Eli> characters that represent windows-1251.  If you can tell what I'm
    Eli> missing here, maybe we could make some progress even without changing
    Eli> the design.

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. Thanks
for the hint, Eli.

Robert