8000 MarkFeatureWriter does not allow multiple anchor marks on the same glyph · Issue #303 · googlefonts/ufo2ft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

MarkFeatureWriter does not allow multiple anchor marks on the same glyph #303

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

Closed
khaledhosny opened this issue Dec 21, 2018 · 10 comments · Fixed by #416
Closed

MarkFeatureWriter does not allow multiple anchor marks on the same glyph #303

khaledhosny opened this issue Dec 21, 2018 · 10 comments · Fixed by #416

Comments

@khaledhosny
Copy link
Collaborator

I believe this is a regression, since my font used to build fine with fontmake 1.4.0 (not sure what version of ufo2ft this used).

If a glyph has more than one mark anchor, e.g. _mark1 and _mark2 only one of them will end up in the generated mark classes. This is caused by the code in: https://github.com/googlei18n/ufo2ft/blob/39ab30c54ab71b24d96bb68e0965c41937d39b35/Lib/ufo2ft/featureWriters/markFeatureWriter.py#L361-L364

I don’t know what the rationale for this, but it is a severe limitation and breaks my fonts. OpenType allows any number of mark anchors on a glyphs and ufo2ft should allow this.

For testing, try building Reem Kufi with latest fontmake and ufo2ft, the string لأ should render like the first image below, but it now renders like the second:
o n

@khaledhosny khaledhosny changed the title MarkFeatureWriter does nlt allow multiple anchor marks on the same glyph MarkFeatureWriter does not allow multiple anchor marks on the same glyph Jan 2, 2019
@anthrotype
Copy link
Member
anthrotype commented Mar 1, 2019

The change was meant to match Glyphs.app behavior. The problem with multiple mark anchors on the same glyph is that the same glyph cannot belong to multiple mark classes within the same lookup subtable, and unlike before when we were creating one mark2base lookup for each markClass (thus they were always disjoint and the problem didn’t arise), we now make a single mark2base lookup.

@moyogo
Copy link
Collaborator
moyogo commented Mar 1, 2019

About that... Null anchors are read as anchors at (0, 0) by InDesign 14.0.1 and maybe others. We didn’t have this issue with split lookups.

@moyogo
Copy link
Collaborator
moyogo commented Mar 1, 2019

I don’t think we should match Glyphs.app here, or at least one should have the option not to.
If one diacritic has more than one mark anchor then the mark2base lookup should be split to preserve the anchors in the source files.

@anthrotype
Copy link
Member

Sounds reasonable. I won’t be able to look into it before second week of March. But I’d happily review PR

@madig
Copy link
Collaborator
madig commented Mar 3, 2019

@schriftgestalt: How does Glyphs handle this case?

@schriftgestalt
Copy link

I don’t think Glyphs can handle multiple _mark anchors. Just to be sure, I can’t find the test font in the linked repo?

@khaledhosny
Copy link
Collaborator Author

I don’t think Glyphs can handle multiple _mark anchors. Just to be sure, I can’t find the test font in the linked repo?

There is both UFO sources and generated OTFs in the repo.

khaledhosny added a commit to aliftype/reem-kufi that referenced this issue Apr 7, 2019
Together with the last version of fontmake that can work with it.
googlefonts/ufo2ft#303
khaledhosny added a commit to aliftype/reem-kufi that referenced this issue May 6, 2019
Copied from ufo2ft commit 3fe4446ec60231baf5bc5f9992bf99feb0be2f92, as
later ones are broken: googlefonts/ufo2ft#303

This allows us to use the latest fontmake again.
khaledhosny added a commit to aliftype/mada that referenced this issue May 6, 2019
Copied from ufo2ft commit 3fe4446ec60231baf5bc5f9992bf99feb0be2f92, as
later ones are broken: googlefonts/ufo2ft#303

This allows us to use the latest fontmake again.
anthrotype added a commit that referenced this issue Jun 26, 2019
…lyphsByAnchor"

This reverts commit 7e28c50.

Probably not such a good idea actually. Using the existing anchors order
allows user to determine which anchor is selected as the "first"
anchor (i.e. the one that assigns a mark glyph to its unique markClass).

See #303 and #336
@anthrotype
Copy link
Member

I have a patch locally that uses fontTools.misc.classifyTools.Classifier to make disjoint sets of markClasses which I then use to build multiple lookup subtables to ensure that mark classes do not intersect. Unfortunately it isn't ready to push and am going on vacation tomorrow. I will continue work on this when I am back in mid July.

@moyogo
Copy link
Collaborator
moyogo commented Nov 21, 2019

@anthrotype What’s the status of your patch? We can work on it if you share the branch?

@anthrotype
Copy link
Member

@moyogo sorry I can't seem to find it any more... Do you want to take this up?

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

Successfully merging a pull request may close this issue.

5 participants
0