I have added and tested type 3 lookup handling, and also added the comments
you asked for.
I will begin on the final branch if there's nothing else to be done.

Thanks for the help!

On Mon, Oct 23, 2023 at 12:54 PM Werner LEMBERG <w...@gnu.org> wrote:

>
> > I need some help figuring out how to handle the type 3 lookups.
> > I need to do 2 things:
> > - Figure out which features contain type 3 lookups
> > - Determine the number of variations the feature contains
>
> Simply add all glyphs a type 3 lookup provides to the list of glyphs.
> No further special handling is necessary.
>
> > For the second one, this function seems relevant:
> >
> https://harfbuzz.github.io/harfbuzz-hb-ot-layout.html#hb-ot-layout-feature-with-variations-get-lookups
> > But this returns a list of lookups if you already know the variation
> > index, when I want to know the range of possible variation indices.
>
> This function is not relevant – it's about variation fonts, see
>
>
> https://learn.microsoft.com/en-us/typography/opentype/spec/chapter2#device-and-variationindex-tables
>
> > hb_ot_layout_lookup_get_glyph_alternates
> > also looks useful and could partially solve the problem.
>
> This is the right function, I think.
>
> > With this function, I can handle the type 3 lookup cases in
> > isolation, only finding the glyphs directly resulting from the
> > feature and no further transformations.
>
> Sounds sufficient to me.
>
> > Also, can I have some advice on testing the code?  How should I make
> > these changes bulletproof?
>
> Alas, we don't have a testing framework for such issues.  However, as
> soon as your code lands in 'master', the Chromium people and other
> parties run their fuzzers on FreeType, which usually unveils memory
> leaks or segfaults quite soon.  They also do intensive comparison of
> graphic images; however, I don't know whether they use the auto-hinter
> for that.
>
>
>     Werner
>

Reply via email to