Subject: bug#71454: 30.0.50; Performance issues with font selection

From: Eli Zaretskii <[email-masked]>
Date: Mon, 10 Jun 2024 16:03:41 +0300

> From: Kai Ma <[email-masked]>
> Date: Mon, 10 Jun 2024 14:34:42 +0200
> Cc: [email-masked]
> 
> I currently use the following config:
> 
> (set-fontset-font t 'han "PingFang TC")
> (set-fontset-font t 'kana "PingFang TC")
> (set-fontset-font t 'kanbun "PingFang TC")
> (set-fontset-font t 'hangul "PingFang TC")
> (set-fontset-font t 'cjk-misc "PingFang TC")
> (set-fontset-font t 'unicode "PingFang TC" nil 'append)
> (set-fontset-font t 'unicode (font-spec :family "Apple Color Emoji") nil 'prepend)
> (dolist (thfont '("TH-Feon" "TH-Sy-P0" "TH-Sy-P2" "TH-Sy-P16" "TH-Tshyn-P0"))
>   (set-fontset-font t 'unicode thfont nil 'append))
> 
> PingFang TC and Apple Color Emoji are built into macOS, and TH-* fonts are from the Internet to cover a
> majority of the Unicode code points.
> 
> For example, 〡〢〣〤〥〦〨〩〸〹〺 belongs to cjk-misc script, and I have to specify a font for it to avoid
> delays.

FWIW, I get instantaneous display when I copy/paste that text into an
"emacs -Q" I just started, even though I have no fonts for the last 3
characters (which means Emacs searches all the fonts installed on the
system).