[HarfBuzz] Better handling variation selectors
behdad at behdad.org
Thu Jun 6 15:00:21 PDT 2013
On 13-04-20 05:49 AM, Jonathan Kew wrote:
> The remaining question is what to do about a VS that was part of a valid
> sequence, but the font being used didn't handle it.
So, apparently Mongolian fonts in the wild implement the Mongolian Variation
Selectors using GSUB, not cmap. 
So, we either need to keep the "unused" variation selectors in the glyph
stream, or remove the Mongolian ones from the cmap processing.
Fixing this the way I like would require a change to the get_glyph() callback
API. Right now we have:
(*hb_font_get_glyph_func_t) (hb_font_t *font, void *font_data,
Now ideally I would have wanted to split that in two:
bool get_glyph (unicode)
bool get_glyph_variant (unicode, selector)
but I'm afraid it's too late to make such a change. Instead, I propose that
we just change the semantics of the existing call and expect that callbacks
return false if the requested variant is not available, and then we will call
them back with variation_selector=0 and will retain the glyph for the selector
in the glyph stream.
More information about the HarfBuzz