[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

script-representative-chars vs incomplete fonts

From: Kévin Le Gouguec
Subject: script-representative-chars vs incomplete fonts
Date: Sun, 12 Sep 2021 00:09:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)


IIUC, fontset.el sets up script-representative-chars so that any font
providing U+1D49C "𝒜" can be used for the whole "mathematical-script"
range (U+1D49C–U+1D4CF "𝒜–𝓏").

On my system, I happen to have

- one font (KpMath) that provides U+1D49C–U+1D4B5 (the "capital" chars),
  but not U+1D4B6–U+1D4CF (the "small" chars),

- another font (DejaVu Math TeX Gyre) that provides both sub-ranges[1].

As luck would have it, when trying to display a char in this range,
Emacs stumbles on KpMath first, and thus fails to display the "small"
sub-range (𝒶–𝓏): I get the dreaded "hex-in-a-box" placeholder for these
"small" codepoints.

The situation is not irremediable; I've thought of at least 3
workarounds[2].  I do wonder though if this situation is something Emacs
should guard against by default, and if so, with what heuristics?

E.g. in fontset.el, would it be overkill to break down the 52-char
ranges in the math-subgroup loop into 2 26-char ranges in order to
always add the "SMALL A" codepoints to script-representative-chars?

(The current loop builds vectors though; maybe we'd want lists?)

I'm sending this to help-gnu-emacs because I'm mostly puzzled; I don't
know if this problem is noteworthy enough to warrant a bug report.

Thoughts welcome.

[1] … minus, of course, the codepoints that do not exist because they
    are redundant with those in the "Letterlike Symbols" block.

[2] 1 and 2 work; haven't tried 3 yet:

    1. (push #x1D4CF (alist-get 'mathematical-script
    2. (set-fontset-font
        t 'mathematical "DejaVu Math TeX Gyre" nil 'prepend)
    3. Uninstall KpMath.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]