Re: Displaying Unicode - font substitution for missing glyphs

Jason Rumney <[email protected]>
Newsgroups gmane.emacs.windows
Message-ID <[email protected]>
John Brown <[email protected]> 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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.