-
Notifications
You must be signed in to change notification settings - Fork 607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reordering fails when GDEF table is absent #2140
Comments
I downloaded that font and there's no GSUB in it. Which means there's also no script/lang tags to trigger USE shaping. |
There’s no features in that font. I added the feature above to it. |
Font with added feature: |
I’m glad it works for you! I wonder why it doesn’t for me... (Using harfbuzz HEAD.) |
It works for me with HEAD. Here's the font where I added the feature and script/lang tag. |
We've done the same thing with other scripts and it's always been working fine. I can't tell why your font might not work because that zip file doesn't open for me. Can you try to attach it again? |
Thanks for having another look. Here's the zip file again. Looking at the differences between your font and mine, it may be that the lack of GDEF table is part of the problem. |
Yes, seems like missing GDEF is a problem. I added GDEF just for these two glyphs and then it seems to work. |
OK. That seems buggy - this behaviour shouldn't depend on the GDEF table AIUI. If I'm reading |
As a further data point, this is different behaviour to CoreText:
|
In this particular case the GDEF shouldn’t matter, but as a general rule I expect a GDEF for correct GPOS/GSUB because those both rely on glyph classes, and/or mark attachment or mark filter classes to function properly. It’s only a simple example like this where the default lookup flags (don’t ignore marks, etc) won’t matter, but any other flags rely on GDEF to know what to do so I don’t think it’s necessarily a bug to fail when no GDEF exists. CoreText might be more forgiving, but we can’t see what magic is inside to confirm. |
HarfBuzz synthesizes glyph classes when |
The root cause is this condition: harfbuzz/src/hb-ot-layout-gsubgpos.hh Lines 669 to 672 in 1b64b73
|
Forwarding my test files (the two OTF files only differ in the existence of an empty GDEF) from n8willis/opentype-shaping-documents#94:
|
If we don't have a guess (eg in a SingleSubst), we just retain whatever class previous glyph had. That's the only sensical thing to do. |
Anyone wants to explain to me in simple terms, what's the observed "bug"? Maybe In general, a complex-shaper font without GDEF is asking for trouble. |
Which is fine when the font has a |
Ignore that. If no |
Exactly. |
Which has the effect of |
Oooh. Is the |
Yes. |
/me fixes that. |
Just change the |
No no. Is more. Am fixing. |
Fixed. WOuld be great if someone can add a test for it. |
This reverts commit f4cd99f. As requested in harfbuzz#2516 (comment)
This reverts commit f4cd99f. As requested in #2516 (comment)
(See this typedrawers thread)
I can see there's code in the USE shaper to note down which glyphs are involved in pref substitutions and then reorder them, but I can't get it to fire. I created a font by adding this feature code:
to my Fallback Plus font, and tried to reorder using the pref feature, but this was the output:
I would have expected
glyph 01 uniA995
. Adding some instrumentation (OK, print statements) into_set_glyph_props
andrecord_pref_use
I got this:So when the substitution is done, the
HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED
is added to the second glyph, but by the timerecord_pref_use
is called, the flag has been cleared.I feel like this is a bug, but I don't have enough USE experience to be confident.
The text was updated successfully, but these errors were encountered: