Meanwhile, is there a way to keep the GPOS class kerning, and still include a reduced kern table (one subtable with max 10920 pairs).
Potentially dangerous. What if an app uses both? Then some kern pairs double up.
Was this not the case anyway when the kern table was cut down to one subtable?
Hi Georg. Where is this API? How can I run Kern Flattener on export?
There is a plugin that contains the Kern Flattener. GitHub - mekkablue/KernFlattener: Glyphs.app plug-in that subsets kerning for the ‘Export kern Table’ parameter (not in the Plugin Manager)
We probably should add a check for a Custom Parameter to know if it should do something. Otherwise it would be applied to all fonts (that have the “Export Kern Table” parameter).
Thanks! I’ll give it a try.
A few notes on this:
- Kerning in PowerPoint does not work if there are any glyphs without Unicode in the kern table. In that context, it makes sense that the Kern Flattener only generates pairs that have Unicode values (see small caps discussion above).
- The Kern Flattener works well. I used it with a temp file, and merged the kern table via TTX. The workflow could be more elegant, though: the Kern Flattener would add the glyph-glyph pairs, without removing the class kerning. The added glyph-glyph pairs will be automatically skipped when GPOS kerning is exported, which means we do not need to work with two separate files. The
Export kern Tablecustom parameter could then be made to export only glyph-glyph pairs and ignore class pairs. Same result*, with less hassle. Would that work? (*Strictly speaking, not identical, as exceptions originally present would also end up in the kern table.)
I have a kern table generator plugin for Corretto Postprocessor that works on the binary font. It will expand the GPOS kerning to pairs, then filter by relevance (Unicode, absolute kerning value, pairs that don’t exist in any language) until the desired number of pairs remains.
Let me know if you’d like to try it. It’s not listed on the Corretto website yet.
There is an API to register a Kern Flattener to be applied during export. I’ll add a sample plugin.
Plugin is up: GlyphsSDK/Python Samples/Kern Table Subsetter at Glyphs3 · schriftgestalt/GlyphsSDK · GitHub
Thanks. I looked at the Python sample and have a question: It looks like it’s essentially a duplication of the Kern Flattener script. I need to include the mekkaKernFlattener.py file in a plugin if I want to use it, correct? Am I allowed to do this for a commercial plugin?
The plugin uses the algorithm from Rainers script and is there to illustrate the API.
I don’t understand the question about the .py file?
The plugin contains a .py file which is essentially a duplicate of the Kern Flattener script: mekkaKernFlattener.py.
Are we allowed to copy this script in our own (commercial) plugins?
You need to ask Rainer.
License is Apache, so I think yes.
BTW GPOS kerning in PowerPoint works fine if there is an fvar table present. Can be an empty one too.
But only in Windows 10+, right?
All windows versions released in the past decade should support this trick. Very unlikely that someone who still runs Windows 7 (current share of installations estimated at approx 1%, probably much less) will buy your font, so relax.
I’m relaxed, just my clients are really annoying and panicking about somebody still using something other than at least Windows 10. I know it’s ridiculous, I tell them so.
In my experience adding a dummy fvar table to static fonts to make GPOS kerning work has the downside that it makes the weights show up double in font menu in Office on Mac?
I have tried making a kern table with KernFlattener and injecting it into a normal font with GPOS to serve both purposes (same as Tim suggests) – I can see that the Aptos fonts in Office use that strategy as well. In that regard have read worries about potential double kerning happening, but have not been able to reproduce that in any apps yet?
Apps either use kern table OR kern feature. Not both. So no worries, there. You don’t “need” KernFlattener, just add a “Export kern Table” custom parameter. KernFlattener will reduce the kern table size considerable. But you can use the plugin that i mentioned above to do it during regular export.