[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Progress update on adjustment database
From: |
Werner LEMBERG |
Subject: |
Re: Progress update on adjustment database |
Date: |
Sat, 02 Sep 2023 05:59:25 +0000 (UTC) |
> I discovered there was an issue when I tried using a test font I created
> with the following as one of its lookups (in ttx format):
> <Lookup index="1">
> <LookupType value="1"/>
> <LookupFlag value="0"/>
> <!-- SubTableCount=1 -->
> <SingleSubst index="0">
> <Substitution in="j" out="i"/>
> <Substitution in="zero" out="one"/>
> </SingleSubst>
> </Lookup>
>
> There is one lookup here, but 2 substitutions. My program needs to
> iterate through each substitution individually, but the function
> hb_ot_layout_lookup_collect_glyphs only returns 2 unordered sets
> representing all the input and output characters for this lookup.
> How can I get one substitution at a time?
Indeed, you can't use use `hb_ot_layout_lookup_collect_glyphs` for
that. However, given that you actually want to map input character
codes to output glyph indices, what about using
`hb_ot_shape_glyphs_closure` on single input characters, iterating
over the auto-hinter 'styles'? If you get a single output glyph,
everything's fine. If you get more than a single output glyph this
essentially means that two or more lookups have been applied in
succession, but you only have to take care of the glyph that is part
of the 'style'.
Note that this is untested on my side – I was just searching in the
HarfBuzz API.
Behdad, if you have a better idea, please chime in :-)
Werner
- Re: Progress update on adjustment database,
Werner LEMBERG <=
- Re: Progress update on adjustment database, Craig White, 2023/09/11
- Re: Progress update on adjustment database, Werner LEMBERG, 2023/09/12
- Re: Progress update on adjustment database, Craig White, 2023/09/16
- Re: Progress update on adjustment database, Werner LEMBERG, 2023/09/18
- Re: Progress update on adjustment database, Craig White, 2023/09/26
- Re: Progress update on adjustment database, Craig White, 2023/09/27
- Re: Progress update on adjustment database, Werner LEMBERG, 2023/09/30
- Re: Progress update on adjustment database, Craig White, 2023/09/30