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

error related to anchors: automatic MARK and MKMK feature writing #680

Closed
cjdunn opened this issue Jul 7, 2020 · 5 comments
Closed

error related to anchors: automatic MARK and MKMK feature writing #680

cjdunn opened this issue Jul 7, 2020 · 5 comments

Comments

@cjdunn
Copy link

cjdunn commented Jul 7, 2020

If I don't have the same anchors in all masters, fontmake will give me an error (see below), which I believe is because it is trying to automatically build MARK and MKMK features.

Generating fonts from Designspace failed: ((2, [2, 1, 1, 1, 1, 1]), 'int', '.FeatureCount', 'FeatureList', '.FeatureList', 'GPOS', '.table', 'table_G_P_O_S_')

It is a bad assumption to think a user who includes anchors in their UFOs always wants these features auto built for them. Could this be off by default?

For some background, here is my common workflow:
–I use anchors to build precomposed accents (using glyph construction)
–My designspace uses sparse masters
–I want to always have a working VF build, throughout the design process
–Currently if I start adding anchors to any UFO, including the default UFO, the VF build will fail because not all other masters have the same anchors.
–As a workaround I can add this "com.github.googlei18n.ufo2ft.featureWriters" to the UFO's lib.plist (thanks @anthrotype for the tip here #607 (comment) ) and then if it's not the default and I add anchors to another master I will have to add this again to the lib.plist of that UFO and so on. And then at the end when all masters have the same number of anchors I could safely remove this from the lib.plist and it should generate.

But to me this is backwards. It seems like users who want to use this auto MARK/MKMK feature writing should have to opt in to this behavior. This doesn't happen for any other features, so why should it happen here? (eg fontmake, thankfully, doesn't look for an /fi glyph and auto write a LIGA feature) Anchors can be used for various purposes. Just because they are present shouldn't be a reason to assume auto features are wanted.

I'd prefer for this to be off by default. But if it's not possible to turn this off by default, could there be a way to specify --no-auto-mark-features from the command line?

Thank you for your consideration!

@cjdunn cjdunn changed the title automatic MARK and MKMK feature writing error related to anchors: automatic MARK and MKMK feature writing Jul 7, 2020
@madig
Copy link
Collaborator

madig commented Jul 7, 2020

But to me this is backwards.

fontmake tries to make Glyphs or glyphsLib exported sources just work, and that means automatic handling of anchors. If you want something else, using the lib key you mentioned is one way of achieving that.

could there be a way to specify --no-auto-mark-features from the command line?

There's a --feature-writer switch already.

@cjdunn
Copy link
Author

cjdunn commented Jul 8, 2020

@madig Ah, I didn't realize I could add: --feature-writer None to my command line script to turn of automatic feature writing. Somehow I thought this was only for using a custom feature writer For anyone else readying this: my other OT features in my .fea file still get written into the font, just no automatic features like MARK and MKMK : )

In that case, I still think --feature-writer None should be the default behavior, but for now at least I know how to do this from the command line and don't have to modify my .ufo files. Thanks again @madig for the help with this 🙏

@cjdunn cjdunn closed this as completed Jul 8, 2020
@cjdunn
Copy link
Author

cjdunn commented May 14, 2022

Update: looking into this closer, I can see that using --feature-writer None removes the MARK and MKMK features that I don't want which are automatically made by fontmake (good) but it also removes GPOS kerning that I do want (not good). Is there a better way to do this? Something like --feature-writer-automatic None? Or --feature-writer-ignore MARK MKMK ?

@cjdunn cjdunn reopened this May 14, 2022
@madig
Copy link
Collaborator

madig commented May 14, 2022

Feature writers write features and you can select those writers but not what they make. It seems you only want the KernFeatureWriter in there and maybe the GdefFeatureWriter.

@cjdunn
Copy link
Author

cjdunn commented May 16, 2022

@madig thank you for the clarification. For anyone else interested, I figured out that the syntax for specifying more than one feature writer is as follows --feature-writer KernFeatureWriter --feature-writer GdefFeatureWriter

So the full line would look something like fontmake -u path/to/my.ufo -o otf --feature-writer KernFeatureWriter --feature-writer GdefFeatureWriter This is working on my end now, thanks!

@cjdunn cjdunn closed this as completed May 16, 2022
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