John Brown <johnbrown_...@yahoo.com> writes:

> Can anyone say how emacs identifies a font that contains a glyph
> that is not present in its current default font, and why it failed
> to find DejaVu Sans Mono? It is not that important; I was just
> testing emacs on a UTF-8 demo file.

Step 1: Check in the default font (that is why the character displays
when the chosen default font contains that character).

Step 2: Figure out which script the character belongs to, and
build a shortlist of fonts which claim to have coverage of that script.

Step 3: Discard any fonts that do not cover the characters listed in
`script-representative-characters', as fonts often lie about which
scripts they cover.

Step 4: Look for the actual character in the shortlisted fonts.



Things can go wrong at steps 2 and 3, either because of deficiencies in
the fonts themselves, or in Windows reporting of scripts covered by the
font.

The situation on X is slightly better, as there is an API for querying
whether a character is contained in a font without allocating resources
for opening the font for drawing, so a more exact search can be done
much more quickly.


Reply via email to