-
Notifications
You must be signed in to change notification settings - Fork 43
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
Fix ligatures with unnumbered contextual anchors having their mark attachment dropped #890
Fix ligatures with unnumbered contextual anchors having their mark attachment dropped #890
Conversation
glyphsLib’s |
Another thing to consider: what happen to non-ligature non-contextual anchors on a ligature glyph (e.g. |
f86ea2b
to
03d831f
Compare
As discussed, here's a refactored approach that 'coerces' contextual numberless ligature anchors to mark2base, consistent with the behaviour of non-contextual anchors I had to change the function from operating in two passes / being called twice (one for mark2base, one for mark2liga) to producing both at once in order to do this If we like this approach I'll update/add tests If the type hints feel like clutter I can remove them, but I'm a fan personally |
the question is, does it work when shaping to have the ligature glyph in a markToBase lookup? |
HarfBuzz has no issue with that. I don't know about other systems. |
It works or not depending on what the type designers/font engineer intentions are. Say we have a |
Make attachments for mark2base and mark2liga in the same pass Coerce numberless liga anchors to mark2base
03d831f
to
f0798ae
Compare
Okay I've rewritten this PR a couple of times now, but there's the reference I used for the latest version, which passes the existing tests locally (which is what I wanted, as I don't believe they cover numberless ligature anchors) Bolded are the cells changed I'll now look to add tests to cover the edge case that I've changed the behaviour for Feel free to code golf me on the implementation of |
Any further refinements I need to make here, or is this all good to get merged? |
If a ligature glyph has a contextual anchor whose name doesn't have a number, it's silently dropped currently. This PR instead sets that anchor number to 1 to be able to keep it around
Previously when using glyphsLib's own implementation of the
ContextualMarkFeatureWriter
(glyphsLib v6.7.1 tested), this was not an issue and the mark attachment worked as expectedLeaving as draft as to confirm this is an okay/safe approach to fixing the problem (maybe some assertions should be added to ensure this isn't clobbering another anchor?). Happy to add unit testing and/or a reproducer as desired
cc @belluzj @jackmcDaMa (who helped me track this down)