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 with GPOS table #715

Closed
RosaWagner opened this issue Dec 7, 2020 · 15 comments
Closed

Error with GPOS table #715

RosaWagner opened this issue Dec 7, 2020 · 15 comments

Comments

@RosaWagner
Copy link

RosaWagner commented Dec 7, 2020

Every month I open an issue about this kind of output message:

Generating fonts from Designspace failed: ((2, [2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1]), 'int', '.LookupCount', 'Feature', '.Feature', 'FeatureRecord', '[0]', 'list', '.FeatureRecord', 'FeatureList', '.FeatureList', 'GPOS', '.table', 'table_G_P_O_S_')

Is there a way to make it more explicit?

@RosaWagner
Copy link
Author

So when I remove the kerning, the fonts build. As soon as I put it back I have this output message. I don't understand, I have the same number of pairs through all masters, very few exceptions… what else could I check?

Is there a way to force Fontmake to build the font even though it finds an inconsistency in the GPOS table?

@moyogo
Copy link
Collaborator

moyogo commented Dec 9, 2020

Which font is this?

@RosaWagner
Copy link
Author

RosaWagner commented Dec 9, 2020

It is not opensource, I can't share it here unfortunately

@anthrotype
Copy link
Member

anthrotype commented Dec 9, 2020

to be "interpolatable", all the masters' GPOS need to have the same number of features. In your font, for some reasons, some masters have less features than others. Could it be that you have kerning in some but not in others? GPOS is not only kern, it may also be mark or mkmk (and others). Those are auto-generated based on the presence of attaching anchors. Maybe these differ across masters?

@anthrotype
Copy link
Member

But yes, the error message could be definitely improved. Possibly a feature request for fontTools.varLib

@anthrotype
Copy link
Member

a way to force Fontmake to build the font even though it finds an inconsistency in the GPOS table?

those inconsistencies make it impossible at the moment to build a valid GPOS table, thus the VF can't be built unless they are fixed.

@anthrotype
Copy link
Member

looking again at the assertion error -- it's not the number of features it is complaining about, but the LookupCount.
So, for some GPOS feature (which the message doesn't tell) there are inconsistent number of lookups: some masters have 2 lookups for that feature, others only 1.

If you could share the sources privately I could take a look and find out what's going on.

@RosaWagner
Copy link
Author

to be "interpolatable", all the masters' GPOS need to have the same number of features. In your font, for some reasons, some masters have less features than others. Could it be that you have kerning in some but not in others? GPOS is not only kern, it may also be mark or mkmk (and others). Those are auto-generated based on the presence of attaching anchors. Maybe these differ across masters?

Thanks. I have no idea… I suspect the designer to have set up some kerning groups for one masters, and then re-did the kerning when created the other masters, and the legacy ones are somehow still remembered by Glyphs. I don't know. All the cleaning scripts I have are not fixing it. I'll investigate towards mrk to mrk…

@RosaWagner
Copy link
Author

RosaWagner commented Dec 9, 2020

If you could share the sources privately I could take a look and find out what's going on.

It would help me so much, can I send it to you by email?

@anthrotype
Copy link
Member

yes, by email is ok

@anthrotype
Copy link
Member

I suspect it might be related to this googlefonts/ufo2ft#314

sometimes the ufo2ft KernFeatureWriter generates spearate kern lookups when there are kern pairs between a base and a mark glyph; for the latter pairs, it creates a distinct kern lookup where ignoreMarks lookupflag is not set; whereas by default it sets ignoreMarks when the kerning is between base glyphs.
Maybe you have such base+mark (or mark+mark) kerning pairs only in some of the masters, so you end up with masters that have incompatible number of kern lookups.
I'm actually not sure how to fix that.

@RosaWagner
Copy link
Author

AH, there is a comb accent with a kerning group… let's test if I remove it…

@RosaWagner
Copy link
Author

It changed slightly the output message:
Generating fonts from Designspace failed: ((1, [1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1]), 'int', '.LookupCount', 'Feature', '.Feature', 'FeatureRecord', '[0]', 'list', '.FeatureRecord', 'FeatureList', '.FeatureList', 'GPOS', '.table', 'table_G_P_O_S_')

It looks like we are close to resolution !

@RosaWagner
Copy link
Author

I did a final clean-up and IT WORKS
Thanks @anthrotype, if I could I would send you a basket of homemade cookies !!!!
So just delete my email eheh

@anthrotype
Copy link
Member

Nice! Yeah, that was it. Some masters contained kerning pairs where one of the members is classified as a combining mark, hence ufo2ft was generating an additional kern lookups for those (but not in all masters, hence resulting in the incompatibility). The solution is either remove the offending kern pairs (if unintentional) or add them to all the masters (a kern of 0 should work)

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