Variation position overrides origin position

I have set up some contextual kerning that worked fine in a single axis design space. Then I have added a second axis, expressed through two ‘virtual masters’ and since then I cannot get the fonts to export anymore as the following error comes up:

I’ve tried to adjust the contextual kerning by adding coordinates of the second axis, but to no avail for now. Can someone tell me what I am doing wrong? Thank you!

At what coordinate is your variable font origin?

It was not set explicitly. I now set it trying different values and it worked once the light master was set to 0.

Interestingly it keeps working now even if I disable the VFO parameter…

EDIT: it works for VF but not for static exports, no matter which VFO I set.

Then it is your first master.

The Variable Font Origin is only relevant for Variable Fonts (as the name says).
the variable kerning is not applied to static instances. Those can use number values tokens to simplify the setup. Improving that is on my list …

Thanks, that’s why I didn’t set it or assumed it could be the problem.

I am not sure I get the problem. I was trying to define contextual kerning, regardless whether the output are static or variable fonts. The error arises when exporting static fonts, at which point the variable origin should be irrelevant, no?

you need to out the variable feature code in a #ifdef VARIABLE#endif block to hide it from the static instances. It would be nice if the variable code could be instantiated for static font, but we are not there, yet.

Thank you for persisting.

For clarification: this has nothing to do with variable fonts, it’s just interpolating kerning values defined in a separate contextual lookup.

The problem appears to be that I have defined four kerning values for the four masters of my weight axis at locations along this axis that are identical to the master positions. Once I define the kerning values on positions that are just off the master positions, everything works as expected. Why I cannot define the kerning values at the master positions is not clear to me.

My masters are situated on positions 2-300-600-1000 on the weight axis. The following kerning definition works:

	pos @Tkern' -250 
		(wght:999) -300 
		@Tkern ;
	pos @Okern-L' -400 
		(wght:301) -450
		(wght:601) -480
		(wght:999) -334 
		@Okern-R ;

Whereas the following kerning definition results in the described error:

	pos @Tkern' -250 
		(wght:1000) -300 
		@Tkern ;
	pos @Okern-L' -400 
		(wght:300) -450
		(wght:600) -480
		(wght:1000) -334 
		@Okern-R ;

What is the coordinate of the Origin?

It works now regardless of the origin as long as the coordinates in the kerning definition do not coincide with those of the masters.

But that can break really easy. You should have values at the end of the axes.

The first value in the pos rule is for the default masters, so you the explicit locations that follow should only be for the other masters.

Ok, but as I said, if I define the kerning value at the end of the axis – i.e. 1000 – I get the error.

I am following the Glyphs tutorial on contextual kerning, I don’t see what I am doing differently.

BTW, there seems to be an inconsistency in the text. It states first that the kerning values can be interpolated, only to then list amongst the drawbacks that ‘Since our lookup is feature code that gets injected into every instance at export time, the contextual kerning does not interpolate.’ Maybe a leftover from an older version?

can you send me the file?

Thanks for the tip-off, I fixed it.

1 Like