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

Anchor propagation differences between ufo2ft and Glyphs #802

Open
simoncozens opened this issue Dec 1, 2023 · 7 comments
Open

Anchor propagation differences between ufo2ft and Glyphs #802

simoncozens opened this issue Dec 1, 2023 · 7 comments

Comments

@simoncozens
Copy link
Contributor

Rendering the sequence H᷊́Hͬ͏̗ in Noto Sans, as compiled by Glyphs, looks like this:

shape

Fontmake, on the other hand, does this, which is wrong:

shape

This is because rcombbelow is made up of a component r plus a _below anchor, and ufo2ft propagates all anchors of the r component (i.e. above and below) so the resulting rcombbelow glyph has an above mark-to-mark anchor.

However! The sequence H᷊᷊ looks like this in Glyphs:

shape

It feels like Glyphs just doesn't propagate any anchors to mark glyphs. Fontmake, on the other hand, gets it right:

shape

I don't know if there's a good solution here, but the results should at least be consistent.

@simoncozens
Copy link
Contributor Author

(Tagging @schriftgestalt because the second example is also, arguably, a Glyphs bug.)

@schriftgestalt
Copy link

The anchor propagation stops when it finds any underscore-anchor. Because it is not clear what anchors are stil valid. When you would use a component to "rcomb", then you can’t use any of the existing anchors.

So the "rbelowcomb" needs a "_below" and a "below" anchor to properly support mkmk.

@simoncozens
Copy link
Contributor Author

OK, I suppose that's a reasonable position to take; the only alternative is to get into weird heuristics to determine whether a mark-to-mark anchor should be propagated (i.e. if your glyph has _bottom, you should not propagate top, you should propagate bottom but what you should do with bottomleft is a mystery).

I guess we should probably do the same thing. Thoughts, @anthrotype?

@anthrotype
Copy link
Member

composite glyph anchor propagation is just a mess, it's entirely undocumented, we have three implementations of it (one in ufo2ft, another in glypshLib, plus of course Glyphs.app's own black box) and nobody except Georg seems to be confident about how exactly it is supposed to work, considering all the various edge cases and hacks accummulated over the years.
I'm dreading the time when I will have to implement this in fontc...

@anthrotype
Copy link
Member

ok apologies for the rant.

I guess we should probably do the same thing

I read this post several times, and I am still not sure what "the same thing" actually means. If you send a PR maybe it's easier to understand what exactly you mean.

Just a reminder, that the ufo2ft propagateAnchors filter is not normally used by fontmake, unless one is building a DS+UFO set of sources ahd has explicitly opted in via the filters lib key; when you build from a .glyphs source it is actually the glyphsLib anchor_propagation.py module that is being used, so the current issue might be misplaced.

@anthrotype
Copy link
Member

It feels like Glyphs just doesn't propagate any anchors to mark glyphs.

I believe @schriftgestalt once confirmed this in another thread googlefonts/glyphsLib#368 (comment)

  1. If it is a Mark and there are anchors, it will not look into components.

... but it looks like we never actually fixed our implementation(s) to match that. We should

@simoncozens
Copy link
Contributor Author

That's what I mean - "we should do the same" as Glyphs does in not propagating anchors in the mark-to-mark case.

anthrotype added a commit that referenced this issue Jan 23, 2024
This is meant to match Glyphs.app's logic, see #802

(A similar fix should be added to glyphsLib's anchor_propagation.py until the latter is superseded by the ufo2ft filter)
anthrotype added a commit that referenced this issue Jan 23, 2024
This is meant to match Glyphs.app's logic, see #802

(A similar fix should be added to glyphsLib's anchor_propagation.py until the latter is superseded by the ufo2ft filter)
anthrotype added a commit that referenced this issue Jan 24, 2024
This is meant to match Glyphs.app's logic, see #802

(A similar fix should be added to glyphsLib's anchor_propagation.py until the latter is superseded by the ufo2ft filter)
anthrotype added a commit that referenced this issue Jan 24, 2024
This is meant to match Glyphs.app's logic, see #802

(A similar fix should be added to glyphsLib's anchor_propagation.py until the latter is superseded by the ufo2ft filter)
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

3 participants