[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [h-e-w] Displaying Unicode - font substitution for missing glyphs
From: |
Jason Rumney |
Subject: |
Re: [h-e-w] Displaying Unicode - font substitution for missing glyphs |
Date: |
Mon, 14 Jan 2013 20:51:37 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
John Brown <address@hidden> 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.