Skip to content
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

Mark is positioned incorrectly after forming ligature #543

Closed
NorbertLindenberg opened this issue Sep 22, 2017 · 5 comments
Closed

Mark is positioned incorrectly after forming ligature #543

NorbertLindenberg opened this issue Sep 22, 2017 · 5 comments

Comments

@NorbertLindenberg
Copy link

NorbertLindenberg commented Sep 22, 2017

I found this bug in Firefox 55.0.3 and reported it as Mozilla bug 1401870; @jfkthame suggested filing it here.

The attached font and HTML file demonstrate a bug that was found during development of a Burmese font. Burmese requires glyph reordering, ligature formation, and mark-to-base and mark-to-mark positioning.

In the test font, the marks u (U+102F) and anusvara (U+1036) are positioned relative to the base nna (U+100F) via anchor attachments. When tested by themselves, this works fine. Positioning of the anusvara also works fine when a medial ra (U+103C) is present. However, when a medial ra is present, the font forms a ligature from medial ra and u in order to position them together. The rule for this is

feature blws {
    script mym2;

    lookup raMedial_uMark_myanmar {
        lookupflag IgnoreBaseGlyphs UseMarkFilteringSet @below_base_myanmar;
        sub raMedial-myanmar uMark-myanmar by raMedial_uMark-myanmar;
    } raMedial_uMark_myanmar;
};

After the ligature is formed, the anusvara is no longer positioned correctly. It appears that the shaping engine loses track of nna as the base and positions relative to the medial ra + u ligature instead.

The same problem does not occur in Safari 11.0 on macOS 10.12.6.

Firefox bug.zip

@NorbertLindenberg
Copy link
Author

More configuration info: This bug occurs in Firefox 56 and in Chrome 61.0.3163.100 on macOS 10.12.6; it does not occur in Safari 11.0 on the same macOS or in Edge 40.15063.0.0 on Windows 10 1703.

@behdad
Copy link
Member

behdad commented Oct 2, 2017

Your GDEF table does not classify the ligature as a mark. That's the bug. Please fix that and reopen if it still doesn't work. Also, "what does Windows do" is also a good question to ask always. I'm fairly sure it does what we do.

@behdad behdad closed this as completed Oct 2, 2017
@NorbertLindenberg
Copy link
Author

NorbertLindenberg commented Oct 2, 2017

Why should the raMedial_uMark-myanmar (uni103C102F) ligature be classified as a mark? I don’t want it to attach to anything, and I do want it to keep its spacing behavior.

The last cluster in the HTML file is U+100F U+103C U+102F U+1036. After reordering, the glyph sequence is
uni103C uni100F uni102F uni1036
After the ligature is formed, the glyph sequence should be
uni103C102F uni100F uni1036
The mark anusvara (1036) follows the base nna (100F) and so should attach to it, no matter what the GDEF says about uni103C102F.

As noted above, the bug seen in Firefox and Chrome does not occur in Edge or in Safari.

Sorry about the name confusion – Glyphs likes to use user-friendly names in the app and the features file, but then produces AGL-compatible production names in the generated font file.

@NorbertLindenberg
Copy link
Author

Please reopen this bug based on the comment above – GitHub doesn’t seem to let me do it.

@behdad
Copy link
Member

behdad commented Oct 3, 2017

Thanks Norbert. You are right. We did not notice the reordering before.

@behdad behdad reopened this Oct 3, 2017
@behdad behdad closed this as completed in 5d98de1 Oct 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants