[HarfBuzz] how to detect missing glyphs e.g. for font substitition

Richard Wordingham richard.wordingham at ntlworld.com
Mon May 11 11:44:52 PDT 2015


On Mon, 11 May 2015 07:56:19 +0000
Louis Semprini <lsemprini at hotmail.com> wrote:

> What is the most reliable and non-font-dependent way to detect
> whether a string being shaped by hb_shape() has led to any missing
> glyphs, and to identify where those glyphs occur?
> 
> When I use the word "missing glyph" here I mean a glyph that is not
> what the user intended for that code point in that context, whether
> that be a little tofu box, a magical hex box, a space glyph (with or
> without zero advance), a diamond, or anything else that has
> substituted for the glyph that the user really wanted.

In so far as the glyph is not just a function of the Unicode scalar
value, there need not be any indicator.  There are a number of
fallbacks that may occur even in a well-constructed font:

1) Optional ligatures may be missing from the font.

2) Indic conjuncts may have a fallback form - Devanagari has two levels
of fallback.

3) As Konstantin mentioned, the default glyph for the base codepoint may
be returned if the requested variation sequence is not supported by the
font.

Also, how many glyphs a pair of regional indicators should yield is
quite undefined - it may be a choice of the font designer to render
them as letters.

Richard.


More information about the HarfBuzz mailing list