-
Notifications
You must be signed in to change notification settings - Fork 611
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
OT shaping fails to form mixed skin tone emoji sequence, CoreText succeeds #2967
Comments
Huh, seems odd. I was going to suggest that the zero-width The two "real" glyphs we get are the expected ones, but something about spacing/positioning is totally off. The Ah, one interesting thing: the
That seems pretty illogical to me; if anything, the first (left-hand) glyph would be a base, and the second member of the couple could be an attached mark. But maybe this prompts Core Text to treat it specially (zeroing its width?), though I still don't see where the 1066 would come from. Ohhhh.... the advance values reported when using
gives us
(Why is 600 the appropriate size to use? I don't know...) This at least looks promisingly similar to the harfbuzz result. Apparently all we'd need to do is to zero the advance of the glyph that has class 3 (mark), but we're not doing so. In No; actually, this buffer location never had mark-ness set, because the glyph originally mapped from U+1F469 was not one of these skin-toned people, it was the basic WOMAN emoji, which is not a "mark" by any stretch of the imagination. So at the point where we did I guess we could update the A further problem is that if we do get Putting all this together, I have a patch that seems to give the desired result here, though it feels a bit hacky. @behdad might want to take a look and see where he feels is the best place to make the various decisions/adjustments. |
When zeroing by GDEF late, we need to re-check the GDEF table (if it is the source of glyph classes) because substitutions may mean that we now have mark glyphs in slots that were not flagged as such initially. Fixes #2967.
@drott if you could test this patch and confirm if it fixes the issue for you, that'd be great - thanks. |
Also, if something like this does look like a useful way forward, the question arises whether we should do it in other shapers where |
Opened a PR for review .... and let's see how badly things break. |
Thanks for the analysis Jonathan! I haven't fully studied what you found and the PR. But just wanted to say:
In gsubgpos.hh we do that already; that is, whenever adding new glyph to buffer, if GDEF classes are present, we consult those for the new gid. Only if there are no GDEF classes, we carry information from before the substitution. It seems like I forgot to implement similar logic in morx impl. |
Humm? This sounds like a serious bug. hb-view bug or library? |
These three places: harfbuzz/src/hb-aat-layout-morx-table.hh Line 265 in b37f03f
harfbuzz/src/hb-aat-layout-morx-table.hh Line 289 in b37f03f
harfbuzz/src/hb-aat-layout-morx-table.hh Line 612 in b37f03f
What GSUB does instead: harfbuzz/src/hb-ot-layout-gsubgpos.hh Lines 732 to 736 in b37f03f
|
Ah, try with |
Thank you for the analysis and fix proposal, Jonathan.
Unfortunately with a clean build with
|
I believe that's a "correct" result, which will render identically to the Core Text version -- the zero-width space glyphs are unimportant. The key point is that we have the two glyphs (I also checked the actual rendering in a Firefox build with this patch, and confirmed it looks correct.) |
That doesn't seem to make any difference when using |
Right, sorry, I missed the difference in that |
OK, sounds like the cleanest fix will be to do the same during morx substitutions. I'll try that and check that it works as expected. |
Fixes issues with mixed skin-tone man/woman holding hands emoji shaping with Apple Color Emoji. See bug below and [1]. [1] harfbuzz/harfbuzz#2967 https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git/+log/b37f03f16b39..1dffb553613d $ git log b37f03f16..1dffb5536 --date=short --no-merges --format='%ad %ae %s' 2021-05-18 drott Chromium build fixes for C++ 17 warning and missing _remap_indexes 2021-05-13 jfkthame [aat] Add testcase for Apple Color Emoji couple-with-skin-tones sequence. 2021-05-13 jfkthame [aat] If shaping via morx, don't adjust mark positioning when zeroing widths. 2021-05-05 jfkthame [aat] Update glyph properties from GDEF if available when doing a replacement. 2021-05-12 grieger Error when link width not in [2, 4] 2021-04-17 qxliu [subset] Add subset () method for COLRv1 Paint tables, BaseGlyphV1List and LayerV1List 2021-05-12 grieger Add hb-ot-color-colrv1-closure.hh to sources list. 2021-05-12 grieger Remove array for visited_paint. 2021-04-01 qxliu [subset] COLRv1 layer/palette indices closure 2021-05-04 grieger [subset] fix failing colrv0 subsetting when font has composite glyphs. 2021-05-06 thomas.stuefe start 2021-03-29 grieger [subset] Add more Noto Nastaliq test cases. Created with: roll-dep src/third_party/harfbuzz-ng/src R=bashi@chromium.org,behdad@chromium.org,bungeman@chromium.org,drott@chromium.org,jshin@chromium.org,kojii@chromium.org Fixed: 1205016 Cq-Include-Trybots: luci.chromium.try:mac10.15-blink-rel,mac10.13-blink-rel,mac10.12-blink-rel,mac-rel Change-Id: Ie37e8357fa821c85d246c8fe2bb9ab6fa47ca8f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2902809 Commit-Queue: Dominik Röttsches <drott@chromium.org> Reviewed-by: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#888400}
Fixes issues with mixed skin-tone man/woman holding hands emoji shaping with Apple Color Emoji. See bug below and [1]. [1] harfbuzz/harfbuzz#2967 https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git/+log/b37f03f16b39..1dffb553613d $ git log b37f03f16..1dffb5536 --date=short --no-merges --format='%ad %ae %s' 2021-05-18 drott Chromium build fixes for C++ 17 warning and missing _remap_indexes 2021-05-13 jfkthame [aat] Add testcase for Apple Color Emoji couple-with-skin-tones sequence. 2021-05-13 jfkthame [aat] If shaping via morx, don't adjust mark positioning when zeroing widths. 2021-05-05 jfkthame [aat] Update glyph properties from GDEF if available when doing a replacement. 2021-05-12 grieger Error when link width not in [2, 4] 2021-04-17 qxliu [subset] Add subset () method for COLRv1 Paint tables, BaseGlyphV1List and LayerV1List 2021-05-12 grieger Add hb-ot-color-colrv1-closure.hh to sources list. 2021-05-12 grieger Remove array for visited_paint. 2021-04-01 qxliu [subset] COLRv1 layer/palette indices closure 2021-05-04 grieger [subset] fix failing colrv0 subsetting when font has composite glyphs. 2021-05-06 thomas.stuefe start 2021-03-29 grieger [subset] Add more Noto Nastaliq test cases. Created with: roll-dep src/third_party/harfbuzz-ng/src R=bashi@chromium.org,behdad@chromium.org,bungeman@chromium.org,drott@chromium.org,jshin@chromium.org,kojii@chromium.org Fixed: 1205016 Cq-Include-Trybots: luci.chromium.try:mac10.15-blink-rel,mac10.13-blink-rel,mac10.12-blink-rel,mac-rel Change-Id: Ie37e8357fa821c85d246c8fe2bb9ab6fa47ca8f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2902809 Commit-Queue: Dominik Röttsches <drott@chromium.org> Reviewed-by: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#888400} NOKEYCHECK=True GitOrigin-RevId: a44afba0d407aa46b871a6e13b9db1ad85566236
For the WOMAN MAN HOLDING HANDS sequence,
With ToT build:
build/util/hb-shape /System/Library/Fonts/Apple\ Color\ Emoji.ttc -u 1F469,1F3FD,200D,1F91D,200D,1F468,1F3FE
I get
[u1F469.3.L=0+800|space=0+0|space=0+0|u1F468.4.RA=0+800]
Expected, with CoreText:
build/util/hb-shape --shaper=coretext /System/Library/Fonts/Apple\ Color\ Emoji.ttc -u 1F469,1F3FD,200D,1F91D,200D,1F468,1F3FE
[u1F469.3.L=0+0|u1F468.4.RA=5+1066]
CC @jfkthame
Edit: For reference, original Chrome issue https://bugs.chromium.org/p/chromium/issues/detail?id=1205016
The text was updated successfully, but these errors were encountered: