Copy KernOn data from one file to another
-
skyrailhighline
- Posts: 17
- Joined: 25 Apr 2021
Copy KernOn data from one file to another
For different reasons sometimes I start setting KernOn pairs in one file and would like to transfer them to another file, is there a correct way to do this? Without going in and copying the data manually in the .glyphs file
Re: Copy KernOn data from one file to another
There isn't really a clean way. I would use a script. What exactly do you mean by "copy Kern On data"? What data do you want transferred, and how? You can't just copy the models without setting values, or rather, if you do, Kern On will (rightfully) complain that you have lots of contradicting pairs.
Or are you talking about different files (versions) of the same font? Please specify exactly what you are trying to do (and why), and then maybe a solution can be found.
Or are you talking about different files (versions) of the same font? Please specify exactly what you are trying to do (and why), and then maybe a solution can be found.
-
skyrailhighline
- Posts: 17
- Joined: 25 Apr 2021
Re: Copy KernOn data from one file to another
I have 2 files v1, and v2.
v1 has had the Kern On models set and the kerning generated.
v2 has not had Kern On run on it. v2 has more masters, a larger character set and perhaps some minor updates to the characters from the v1 character set but nothing that should change kerning.
The workflow is a result of working with different designers and also needing to reduce the scope of Kern On to relevant masters originally.
How do I transfer the work I've done in Kern On in v1 to v2.
v1 has had the Kern On models set and the kerning generated.
v2 has not had Kern On run on it. v2 has more masters, a larger character set and perhaps some minor updates to the characters from the v1 character set but nothing that should change kerning.
The workflow is a result of working with different designers and also needing to reduce the scope of Kern On to relevant masters originally.
How do I transfer the work I've done in Kern On in v1 to v2.
Re: Copy KernOn data from one file to another
You need to copy two things: The kerning (which Kern On uses in order to know the values for the models) and the models.
Internally, the models are just a list of glyph name pairs, like: ["A H", "hyphen one", "H period"]. Kern On then looks at the actual kerning values for those glyph pairs, so Kern On doesn't actually store the values of the models separately.
The easiest way is probably to open copy the kerning from the relevant master in v1 into the corresponding master in v2. Then copy the data in GSFontMaster.userData["KernOnModels"] from v1 into v2. All this without Kern On open. Once you've done this, open Kern On.
Internally, the models are just a list of glyph name pairs, like: ["A H", "hyphen one", "H period"]. Kern On then looks at the actual kerning values for those glyph pairs, so Kern On doesn't actually store the values of the models separately.
The easiest way is probably to open copy the kerning from the relevant master in v1 into the corresponding master in v2. Then copy the data in GSFontMaster.userData["KernOnModels"] from v1 into v2. All this without Kern On open. Once you've done this, open Kern On.
-
skyrailhighline
- Posts: 17
- Joined: 25 Apr 2021
- Tim Ahrens
- Site Admin
- Posts: 502
- Joined: 11 Jul 2019
Re: Copy KernOn data from one file to another
... unless they are autokerned. Then you can switch them to models and there shouldn’t be any complaints (oops, this sometimes happens anyway, which is a kind of bug, I need to investigate).
Let me quote from the manual (https://kern-on.com/manual/):
To “transfer” all models to a different master or font, show them, go to the other master (or font, using copy and paste), select all and switch the pairs to models. At this moment the new models will have their previous autokerning values. In order to transfer the model pairs’ values as well you could close Kern On and use Glyphs’ Kerning Window (⌘⌥K) to copy and paste all kerning from one master or font to the other. As you start Kern On again, it will use these new values (internally it only stores which pairs are models but not their values; these are taken from Glyphs). Any autokerning values you may have transferred during the process will simply be ignored and discarded. Because of the different shapes and spacing in their “new home”, some models may have to be removed by Kern On.
Keep in mind that Add models and independents from in the menu is often more convenient.
So, I don’t think scripting is the only way to go but it can be more convenient if you are used to it.