Subject: bug#43177: Bug: Emacs 27.1 hangs forever in `FcCharSetSubtractCount' from '/usr/lib/libfontconfig.so.1'

From: Robert Pluim <[email-masked]>
Date: Fri, 04 Sep 2020 16:04:35 +0200

>>>>> On Fri, 04 Sep 2020 16:30:41 +0300, Eli Zaretskii <[email-masked]> said:

    >> From: Robert Pluim <[email-masked]>
    >> Cc: [email-masked],  [email-masked],
    >> [email-masked]
    >> Date: Fri, 04 Sep 2020 15:05:52 +0200
    >> 
    >> +          {
    >> +            list = Fcons (val, list);
    >> +            /* Querying further backends can be very slow, so we only do
    >> +               it if the user has explicitly requested it (Bug#43177).  */
    >> +            if (query_all_font_backends == false)
    >> +              break;
    >> +          }

    Eli> Shouldn't we query those other backends if the first one couldn't find
    Eli> a font, even if the variable is nil?  Otherwise, this change could
    Eli> cause regressions in some (hopefully rare) cases, whereby some
    Eli> characters will display as hex codes where previously they were shown
    Eli> using some font.

Thatʼs what this does. The variable is only checked if (ASIZE(val) >
0), if we find zero fonts we go to the next backend.

I tested it before I sent the patch :-)

Hereʼs what I get for Cantonese in etc/HELLO:

              display: by this font (glyph code)
    ftcrhb:-GOOG-Noto Sans CJK KR-normal-normal-normal-*-13-*-*-*-*-0-iso10646-1 (#x4F01)

And hereʼs what I get for Korean:

              display: by this font (glyph code)
    x:-daewoo-mincho-medium-r-normal--16-120-100-100-c-160-ksc5601.1987-0
    (#x3E4

Robert