Small kern pairs

Post Reply
Hoops
Posts: 9
Joined: 29 Sep 2021

Small kern pairs

Post by Hoops »

I don't know if it has already been discussed, but at the end of the kerning process, Kern On inserts a lot of very small kernings that are essentially useless (-1 +1, -2 +2). Is it possible to delete them without deleting the Model that have those values? I don't know if it makes sense to create a tolerance in which kernings below a certain values are automatically removed.
User avatar
Tim Ahrens
Site Admin
Posts: 424
Joined: 11 Jul 2019

Re: Small kern pairs

Post by Tim Ahrens »

Yes, this has been discussed before:
viewtopic.php?t=180

It’s a bit unusual to get +1 and -1 values. What is the x-height of your font?
Hoops
Posts: 9
Joined: 29 Sep 2021

Re: Small kern pairs

Post by Hoops »

My mistake, I should have searched for the specific topic in the forum before writing. I read the thread and your explanation makes a lot of sense. The font in question has an x-height of 470 (Can I ask you why is important?). Anyway In the desktop workflow process, I tend to limit the table to roughly 20-25kb, which I realize that maybe it is a limit that no longer makes much sense for desktop use. However, the final result generates many zero kernings (Models) and many small kernings that I see as a noise in the overall economy of the font. Anyway, thank you for your quick response.
User avatar
Tim Ahrens
Site Admin
Posts: 424
Joined: 11 Jul 2019

Re: Small kern pairs

Post by Tim Ahrens »

Some parts of the code normalize things, and use the x-height as a measure of the “scale” of the font. If you have a font at 250 UPM you may have an x-height of less than 100, and if you draw at 4096 UPM it will be well over 1000, of course. I just had another look at the code and made additional tests, though, and found that Kern On should never create autokerning values of -1 or +1. Are you sure this is happening?

There shouldn’t be “many” zero kerning pairs in relation to the overall number of generated pairs. You have a handful of zero models and sometimes zero-value exceptions (and these are not superfluous). Keep in mind that zero kerning pairs will be omitted when the fonts are exported, except for zero-value exceptions, of course, Glyphs is smart enough to see this.

Not sure I understand which kind of economy you mean. Is it about (human) effort? That doesn’t make a difference. File size? That can be ruled out, as I explained in the other thread. I also wouldn’t consider it noise, do you think it will have a negative visual impact on the font? Or, are you talking about “noise” in the Kerning Window in Glyphs? There is not much reason to even open the window. My advice is, just close that Kerning Window and stop wasting your time worrying about irrational problems.
User avatar
SCarewe
Posts: 109
Joined: 23 Apr 2021

Re: Small kern pairs

Post by SCarewe »

Coming back to this. I would really appreciate being able to define a lower limit of units for kerning pairs. Example: I often have simple obliques of roman masters, where I use the Autokern from... feature. Almost always, this results in wrong kerning pairs in the italics. I might have the model l–l in my roman, set to 0, and in the italic, I will often get +2 as my kerning for l–l. Kerning below 5 units is, in my eyes, almost always a mistake and a result of either faulty spacing or a kerning algorithm error. Currently, what I do is run Kern On to generate this wrong kerning (such as +2 for l–l, etc.), and then remove all kerning below 5 units on export.
User avatar
Tim Ahrens
Site Admin
Posts: 424
Joined: 11 Jul 2019

Re: Small kern pairs

Post by Tim Ahrens »

Okay, I am slowly getting willing to implement a higher (or customizable) threshold for kerning values. Sometimes you just have to be persistent. ;-)

The reason why I think a higher threshold would be beneficial is that it makes the kerning in woff/woff2 more compressible. It’s quite amazing how other lossless tricks don’t improve the compression in woff2 because it is such a good compression algorithm. Even pure glyph-glyph kerning is nearly the same size when compressed. Anyway, I digress.

If these small kerning values are an indicator of mistakes then what to do about them? We can say, never mind, they are just little glitches that we want to ignore when the kerning is generated. We can live with these flaws as they are almost imperceptible. That’s the pragmatic and economical approach. Or, we can say, we are perfectionist, and Kern On helps us create better spacing (not just kerning), and this indicator is useful for finding these mistakes as we want to fix them. Maybe, if the threshold only applies for finalization but not the on-the-fly kerning then that would do the trick?
User avatar
brianbrubaker
Posts: 28
Joined: 21 Jun 2021

Re: Small kern pairs

Post by brianbrubaker »

As a recovering perfectionist, I love that Kern On helps find inconsistencies in spacing. I like the idea of being able to set a threshold at finalization, but I just wanted to share that I do think it's helpful to see kerning pairs below a 5-pt value while I'm refining and adjusting models.
User avatar
SCarewe
Posts: 109
Joined: 23 Apr 2021

Re: Small kern pairs

Post by SCarewe »

Yes, I would definitely only apply this upon finalisation. I use the small kerning pairs generated on the fly in order to fix spacing issues, I wouldn't want to miss those.

By the way, any plans for a separate spacing tool? In harmonious conjunction with KO, that would be the ultimate game-changer.
User avatar
SCarewe
Posts: 109
Joined: 23 Apr 2021

Re: Small kern pairs

Post by SCarewe »

Hi, I am still wondering why this happens pretty much constantly in italics. I am getting +2 on the most basic pairs such as ll, HH, ln, etc. when I set it to autokern from the roman masters.

The spacing is identical, there is no way to remedy this apart from copying all models from the roman and adjusting them all by two units.

Any idea why this is occuring? The italic angle is (almost) perfectly retained by my shapes. I have an italic angle of 9.5°, which equals out to a 1 by 6 slant. My ascenders (as pictured) are at 120 by 716, which, to be fair, amounts to a 9.64° slant. Is this the problem?
Attachments
Screenshot 2023-07-01 at 14.11.26.png
Screenshot 2023-07-01 at 14.11.26.png (347.89 KiB) Viewed 8451 times
User avatar
Tim Ahrens
Site Admin
Posts: 424
Joined: 11 Jul 2019

Re: Small kern pairs

Post by Tim Ahrens »

If you slant a correctly spaced font then that means in practice, the spacing is usually still pretty much correct. If you look at it from a geometric perspective, though, you can’t say that nothing happens to the space between the shapes. One thing is, the distance between the shapes gets smaller if you measure perpendicular, i.e. the smallest distance between the shapes (even though it stays the same if you measure horizontally, of course). Another thing is that the shapes get taller/longer if you measure along the shape (again, of course, they keep their “length” if you measure vertically).

The most fundamental principle of spacing is that tall shapes need more distance against each other than less tall shapes. Imagine a purely rectangular/techno sans design. Of course, the P would have a smaller RSB than the D because its front is less tall. To go even further, the typical sans serif T has much smaller sidebearings than the H because its front is much less tall. (When you look at diagonals and rounds the question “How tall is the front” becomes much more fuzzy, this is why the development of KO took 4 years instead of 4 weeks. Still, that’s the central principle of the engine.)

This is why it makes perfect sense, from a rational and visual point of view, to say, the slanted italics need a little more space for the flats, given that the spacing is supposed to be exactly as the uprights. (KO does not yet support the concept of intentionally tighter italics, like a global special spacing.)

Also, look at the diagonals: after slanting HVH, the angle of the left stem of the V against the H has become larger, it has become more “pointy”. Plus, the tip of the V only faces the H at a point where part of the H’s front is missing: looking from the tip of the V towards the H perpendicularly you will no even hit any black. On the right of the V, the effects are the opposite. Surely, the white area between the letters is guaranteed to remain the same but if you look very carefully you will see that after slanting, the V is no longer centred in HVH, it needs to be shifted left by a small amount to fix this.
User avatar
Tim Ahrens
Site Admin
Posts: 424
Joined: 11 Jul 2019

Re: Small kern pairs

Post by Tim Ahrens »

Another important thought: When we design typefaces, we do two things: Looking, and Thinking. Some decisions are based on Looking, such as “The w needs to be a little wider”. Other decisions are based purely on Thinking. While Thinking can be powerful and efficient, it can be

(1) undeniably correct,

(2) nothing but personal habits, or

(3) an error in reasoning.

If, for example, you say, the sidebearings of the m must be identical to the n, based on Thinking, not Looking, then that’s probably undeniably correct. It’s elegant and efficient and more precise than spacing the m by Looking, even if you are an experienced designer.

Personal habits are perfectly okay. If something works for you and it leads to good results, why not develop habits. They can certainly make the design process quicker and more predictable. It’s still important to be aware of what this kind of Thinking is: it’s not undeniably correct, and if KO insists on something that contradicts your habits then you need to be flexible enough to change them. I tried hard to make Kern On support a wide range of designers’ habits but in the end, there are limits to KO’s flexibility if the paradigm is that the results must be consistent in some way.

Finally, if you prefer to Think rather than Look there is always the risk that your Thinking is sometimes simply incorrect. We’re human, after all. This is why it is always good to use Looking as an additional means.

What I want to say: If you insist that the +2 generated by Kern On is wrong, is this based on Thinking or Looking? Does the spacing really Look to loose to you, if it has +2 (or, 0 after you adjust the sidebearings of the flats)? Or do you Think the +2 is wrong? If so, are you sure it’s the type (1) kind of Thinking?

What I do in such a case is to assume KO’s Thinking is more precise than mine, and then adjust the sidebearings unless that really Looks wrong to me.

Hope this makes sense!
Post Reply