[HarfBuzz] get glyph from feature only
Jonathan Kew
jfkthame at gmail.com
Thu Dec 10 08:23:04 PST 2015
On 10/12/15 11:08, Werner LEMBERG wrote:
>
> What's the easiest solution to find out whether a character (or
> character cluster) gets handled by a feature?
>
> The only way I'm aware of to solve this is to call `hb_shape' twice,
> with and without activating the feature, then comparing the resulting
> glyph indices and positions for differences. Is there a simpler way?
What's your actual use case here?
And what do you mean by "gets handled by a feature"? It sounds like you
mean "the output is different than it would have been without the
feature". What if the result has the exact same glyph indices and
positions, but different cluster values? What if the result could have
been affected by the feature in question, but a different feature is
masking it -- do you want to consider it "handled" or "not handled"?
What if the feature may or may not affect the given character, depending
on context far beyond the cluster itself?
You might want to try collecting the relevant lookups for the feature
(see hb_ot_layout_collect_lookups) and then the set of glyphs referenced
by those lookups (hb_ot_layout_lookup_collect_glyphs)... but that
doesn't tell you whether the lookups will in fact modify the result, as
there could be lookups that match the relevant glyphs but actually leave
the output unchanged.
JK
More information about the HarfBuzz
mailing list