[HarfBuzz] Better handling variation selectors
Behdad Esfahbod
behdad at behdad.org
Thu Jun 6 15:55:05 PDT 2013
On 13-06-06 06:49 PM, Konstantin Ritt wrote:
> Hi Behdad, list,
>
> the alternative you've suggested does make sense;
> but in my opinion, it is better to change the API now, until 1.0, to make it
> more intuitive/cleaner than be a hostage of some "tricky" cases for the next
> 10-15-20 years...
I understand. But then every implementation has to be changed, and it will
drive distros really mad. It wreaked havoc when I moved hb-icu functions into
their own library already...
I'll think about it a bit more. I'm hesitant to make such a big break at this
point.
behdad
> Regards,
> Konstantin
>
>
> 2013/6/7 Behdad Esfahbod <behdad at behdad.org <mailto:behdad at behdad.org>>
>
> 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. [1]
>
> 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:
>
> typedef hb_bool_t
> (*hb_font_get_glyph_func_t) (hb_font_t *font, void *font_data,
> hb_codepoint_t unicode,
> hb_codepoint_t variation_selector,
> hb_codepoint_t *glyph,
> void *user_data);
>
> Now ideally I would have wanted to split that in two:
>
> bool get_glyph (unicode)
>
> and
>
> 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.
>
> Makes sense?
>
>
> [1] https://bugs.freedesktop.org/show_bug.cgi?id=65258
>
> --
> behdad
> http://behdad.org/
> _______________________________________________
> HarfBuzz mailing list
> HarfBuzz at lists.freedesktop.org <mailto:HarfBuzz at lists.freedesktop.org>
> http://lists.freedesktop.org/mailman/listinfo/harfbuzz
>
>
--
behdad
http://behdad.org/
More information about the HarfBuzz
mailing list