Replace/Add Feature for kerning

Hello. I am trying to write the kern feature manually (with just one lookup). For this, I need to replace the code in the kern feature with my own code. Instead of adding a kern feature with code for each instance and then export each instance separately (activate only one instance, edit the code in kern export, activate only next instance, repeat…), I would like to add this code to each instance as a custom parameter.

So far, neither Add feature nor Replace feature have worked. Why is this? Any way I can do this? Thanks!

The “Add Feature” works for me in 3.2. But it will also add the default kerning.

I had a look and I think I improved it. If you add a # Automatic Code in your code (either at the beginning or end), you get both, the manual and the automatic code. Without it, only the manual code.

Hello again, sorry I didn’t get back on this.

Indeed, this works as expected in 3.2 (except that if, for whatever reason, you have a “kern” feature added in Font Info>Features, that one will be used, and not the one from the Add Feature parameter). But only if there is no kerning present in the font. How do I replace the kerning upon export?

I have one more question, what is currently the best of generating kerning with only one lookup?

I already manually removed the lookups in my 20 instance fea files, but for the future, how would a single-lookup kerning be best achieved? Thanks!

“Replace Feature” doesn’t work for kern, this is very annoying.

If I use “Remove Features”, add kern, with “Add Feature” to replace with my new kern code, no kerning feature is exported.

I’m sorry to go on about this, but I’m afraid single-lookup kerning is vital for making fonts work on old Windows systems.

Further edit:

Is there some way of referencing fea files?
I have all my manually prepared kern feas in the same repository/directory on my computer. Is there a way to reference the respective file instead of copying the entire kerning code?

Maybe place the lookup in a prefix, reference that from the kern code and replace the prefix.

And there is the standard Feature code include statement for including external files.

What exactly are trying to do?

You have
a) the default kerning (in the Kerning Panel)
b) manually written kerning feature (in Font > Features).
c) a “Add Feature” parameter in an instances.

What should be in the final file?

What I have:

Latin only, default kerning (in the kerning panel). The end result I want is exported kerning with one single lookup.

I prepared .fea files with all kerning in one lookup. I have duplicate .glyphs files with kerning removed.

Using “Add Feature” in the files with no kerning works fine.

What I want to do (already as my workaround for single-lookup kerning) is work with my main file which includes kerning.

For that, I would expect one of the following to work:

  • Add Feature kern replaces the kerning completely.
  • Replace Feature kern replaces the kerning completely.
  • Include Feature kern replaces the kerning completely.

None of these work.

Have you tried the “Keep Kerning in one Lookup” CP?