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
GSUB behaviour differences between harfbuzz and MS Word #3545
Comments
Thanks. Indeed, removing that condition fixes it. Can I use your test font in our test suite? |
Sure, feel free to use the font. The glyph outlines come from the "Go Regular" TrueType font, which can be re-distributed under a BSD 3-clause license https://cs.opensource.google/go/x/image/+/master:font/gofont/ttfs/README . You probably need to put a copy of this licence next to the font. As far as my changes to the font are concerned (subsetting, conversion to Opentype etc.), I'm happy for you to use these in any way you see fit. |
Somehow |
One idea: there are very few glyphs in this font, to keep the file size small. Maybe you tried glyphs which are simply not there? It's just the capital letters A-Z, space, and three extra symbols which I plan to use for GPOS alignment tests. |
Interesting. HB_DRAW=0 works, but HB_DRAW=1 fails. And this is a CFF font. Who wants to debug this, ugh. cc @khaledhosny @ebraminio |
The harfbuzz/src/hb-ot-cff1-table.hh Lines 1136 to 1139 in 6454cec
The harfbuzz/src/hb-ot-cff-common.hh Lines 284 to 291 in 6454cec
Without knowing much about the code, I assume the first check should be true, but |
If I remove the empty Subrs from the Private dict and rerun ttx the font renders fine, so this empty index our code is tripping over. |
It seems that FontTools does not write |
This check is definitely wrong. If count is zero, nothing else is encoded. Thanks for debugging this. I know the fix. |
Fixed it. |
I constructed a test font which has two GSUB lookups:
lookup 0 (type 5, format 1): this only applies if the input is one of AB, AAB or AAAB. For these inputs it recursively applies lookups 1 (adding another A) and then lookup 0 again.
lookup 1 (type 2, format 1): this replaces A -> AA.
Using this font, the current version of Word from Office 365 (on Mac) and the Mac "Font Book" typeset the input "AB" as "AAAAB", while harfbuzz just gives "AAB". From my reading of the OpenType spec I believe that "AAAAB" is correct.
The font file (both as .otf and decoded via ttx) is here:
I believe that the problem is caused by the following test:
harfbuzz/src/hb-ot-layout-gsubgpos.hh
Lines 1418 to 1421 in 9e59c40
The text was updated successfully, but these errors were encountered: