Working with collaborators with KernOn

Post Reply
aaronbell
Posts: 3
Joined: 19 Nov 2021

Working with collaborators with KernOn

Post by aaronbell »

I am going to be working on a project soon where a collaborator will be working on the Cyrillic portion of the work. We are interested to use KernOn on the project, but it isn't clear to me how I can provide my collaborator with any master kerns that I add to the file, or integrate the master kerns my collaborator adds for the Cyrillic portion.

Is there a way that we can do our individual portions separately and then merge together? Or will I need to send my version with the kern data over to my collaborator to do the kerning afterwards?

Thank you for your advice / recommendations!
aaronbell
Posts: 3
Joined: 19 Nov 2021

Re: Working with collaborators with KernOn

Post by aaronbell »

Following up on this. Any recommendations?
Thanks.
User avatar
SCarewe
Posts: 61
Joined: 23 Apr 2021

Re: Working with collaborators with KernOn

Post by SCarewe »

Hello, yes, this is possible. You can copy, edit, and write the models and values for any file.

The models are stored in each master's userData as a simple list. Read these and their kerning values from the font kerning, then merge the two lists. Should be a very short and easy script. If you need help with this, please let me know, I am writing on a bundle of Kern On scripts at the moment anyway.
User avatar
Tim Ahrens
Site Admin
Posts: 231
Joined: 11 Jul 2019

Re: Working with collaborators with KernOn

Post by Tim Ahrens »

Sorry about the late reply.

Not sure how exactly your workflow is, how you merge the two versions of the design, but there are ways to combine the models of different fonts.

Are you familiar with working on .glyphs files in a text editor (or even with Git)? If you open the file in, say, BBEdit (which has a particularly convenient compare-and-merge function) you can easily spot the differences between the files if there aren’t too many of them.

As Sebastian mentioned, the models are stored in the master’s userData. Same for the independent pairs. The special spacing settings are stored in the glyph’s userData. You can easily spot the Kern On data in the font by searching for “KernOn” in the text editor. Don’t worry about the “KernOnName” entries, they are not to important, you can practically ignore them. Their only purpose is to correctly identify models if glyphs are re-named while KO is sleeping (which you should not do while KO is running, btw.).

Keep in mind that Kern On only stores the model pairs (i.e. their glyph names) but not their kerning values. The kerning values are stored using Glyphs’ default system.

I realise that Kern On needs a built-in function to transfer and merge models (and independent pairs) between fonts (or masters). I’ll see how quickly I can implement that. Stay tuned!
aaronbell
Posts: 3
Joined: 19 Nov 2021

Re: Working with collaborators with KernOn

Post by aaronbell »

Thank you both! I don't often crack open Glyphs files in a text editor but I don't have a problem with doing so.

I haven't locked down the process I'm planning to use, but it sounds like there's several key sections that will need to be merged. Specifically:
"KernOnIndependentPairs"
"KernOnModels"

Then copy all of the kern data in from the other font and hope that the kern models line up :).

I also see a lot of "KernOnSpecialSpacing" — are these similar to "KernOnNames" and can be ignored? Or will they also need to be merged?
User avatar
SCarewe
Posts: 61
Joined: 23 Apr 2021

Re: Working with collaborators with KernOn

Post by SCarewe »

Hello, KernOnSpecialSpacing (glyph-level userData) describes the spacing group assigned to each side of a glyph. So, for example, your tabular figures will have "L: NoKerning, R: NoKerning" set as their values. Or "L: smallcaps, R: smallcaps" for your smallcaps, you get the idea.

For your project, from what I gather, your models won't overlap, so you can really simply append all items from one list to the other from your two Glyphs files. Do that inlcuding the kerning for the specific pairs, and you're done.

for model in Font.selectedFontMaster.userData["KernOnModels"]:
LGlyph = Font.glyphs[model.split(" ")[0]]
RGlyph = Font.glyphs[model.split(" ")[1]]
kern_value = Font.kerningForPair(Font.selectedFontMaster.id, LGlyph.name, RGlyph.name)
print(model, kern_value)

Sorry I can't properly write code here, but if you want, you can check out how this script works, it does the same for values/models between masters: https://github.com/eweracs/glyphs-scrip ... mMaster.py
User avatar
Tim Ahrens
Site Admin
Posts: 231
Joined: 11 Jul 2019

Re: Working with collaborators with KernOn

Post by Tim Ahrens »

aaronbell wrote: 09 Dec 2021 "KernOnIndependentPairs"
"KernOnModels"

Then copy all of the kern data in from the other font and hope that the kern models line up :).
The problem is that this would copy the models but not their values!

I just published an updated version, see https://kern-on.com/update. Now we have a dedicated feature in the gear menu (which has three dots, not a gear in newer macOSes). Just open the other font and select the corresponding master you want to copy the models from. If there are contradicting models in the other font/master it will ask the user whether to update the values. Does that make sense in terms of UI?
User avatar
Tim Ahrens
Site Admin
Posts: 231
Joined: 11 Jul 2019

Re: Working with collaborators with KernOn

Post by Tim Ahrens »

Thanks for pointing us to these scripts, Sebastian! I will have a closer look at them. So, it seems you find there is some missing functionality in Kern On itself? Ideally, the tool should provide all the functionality without the need for additional scripts.
User avatar
SCarewe
Posts: 61
Joined: 23 Apr 2021

Re: Working with collaborators with KernOn

Post by SCarewe »

Hi Tim, I have been writing these scripts mostly for foundry-internal use, just as we see need in our workflow. Things like copying zero models to smallcaps or from numbers to small figures isn't something I think needs to be in Kern On itself. The idea is also, with scripts like Print Master Models, that you don't need to re-open Kern On, which would delete the finished kerning. Like that, you can do quick proofing when reviewing projects.

Set Base Models is also something that relies heavily on preference (which, ok, is also why it allows the default list to be edited), also Set Special Spacing. These scripts (in my opinion) really only make sense as external add-ons. Then there's the very simply Clean Kerning Groups script, which of course only exists because Kern On adds the KO_ prefix to all kerning groups ;)

I would be very happy to hear your thoughts on them, as I am pretty much experimenting on the fly and surely breaking a lot of stuff. I have a list with other script ideas I am planning to work on:
Batch edit KO models (change capital kerning, one-click remove models, add models globally, etc)
Check model consistency (print a list of models missing between masters)
Merge KO models (for cases like Aaron's – but it seems your update addresses this)

The more scripts I write the more they overlap somewhat in functionality, which is annoying, but I'll try and keep up with what you develop and adjust accordingly. Thank you!
Post Reply