Testing consecutive kerning pairs for consistency, Vs kerning single pairs alone

PabloImpallari
PabloImpallari Posts: 806
edited July 2016 in Technique and Theory
Hi all,
I recently spotted a kerning problem in one of my fonts, in a word having consecutive kerning pairs.
At first glance I thought it was my fault only, but after looking at some fonts from the big guys we all admire, I discovered that this problem was much more frequent, and that many people suffer from the same issue.

The problem was inconsistent fitting in words made of consecutive kerning pairs.
For example, consider the word "Waves" having 3
consecutive pairs: Wa + av + ve

I think the reason for this, is that when we kern single pairs, they may look good on their own.
But when we find such words, where a pair follows another pair and then another pair and then another, the small inconsistencies add-up and the problem becomes more evident.

So, I want to generate a list of words that include a pattern of consecutive kerning pairs.
Having a set of test words will allow us to better double-check for kerning consistency "across pairs", to be used as a second-pass after the kerning of single pairs is done. For extra refinement.

Basically, I need help from some magic programmer who can make a script to detect that kind of words inside a dictionary. Once I have the list of words, I will upload it to the testing page for everyone else to use.

I can provide the pairs list to be used as "seed" for the script to detect the words.
Anyone up to the challenge?

Tagged:

Comments

  • One very important consecutive pair is L quoteright A. Both pairs L+quoteright and quoteright+A might have quite bit negative kerning. But in this combination, the L and A might overlap. This can happen with f.W, too.
  • Chris Lozos
    Chris Lozos Posts: 1,458
    I find a similar issue with kerning symmetrical letters to curves, as in "ovovo" when next to straight letters like n or u the curve to a diagonal glyph can look too tight "uovn".
    I don't know if such pairs should be part of your list or if this is a totally different phenomenon?
  • Pablo, as part of your process are you simply missing these particular words that have multiple consecutive kerning pairs?

    I check against an extensive word list with almost every pair combination that would occur in a given font style. I'll use made-up words/strings such as dovok dovak dovsk davok dsvok dovok dovak dovsk  davok dsvokv. I also check for a sensible balance amongst pairs with somewhat related glyph negative space. A general spacing balance with pairs such as TANE YANE FANE PANE ÞANE etc.

    It would be more ideal if they were real words, but it works that it generally reads as a real word when set in a paragraph and easily allows multiple related shape glyphs paired against a key glyph.

    I also try and look at known pair problems like the L quoteright A and other anomalies.
  • James Puckett
    James Puckett Posts: 1,992
    This can happen with f.W, too.
    I think the worst offender is r/f w/v/y in fonts that kern against space. The space often disappears, so phrases like “of yours“ and “for you” appear as “ofyours” and “foryou”.
  • James Puckett
    James Puckett Posts: 1,992
    Basically, I need help from some magic programmer who can make a script to detect that kind of words inside a dictionary. Once I have the list of words, I will upload it to the testing page for everyone else to use.
    I have a better suggestion. A script that can break down the kerns in a font from their kern groups and search for them in a text file (password cracking dictionary), including words that contain sequential kerning pairs. It could still be part of the testing page because users could upload an AFM file for analysis. This would allow users to do things like dump the text of a newspaper to a corpus, or limit themselves to specific languages.
  • Simon Cozens
    Simon Cozens Posts: 740
    Actually I have been thinking of doing this sort of thing to test kern pairs more efficiently: have a small number of words that test a large number of pairs. I'll work on it next week.
  • Simon, we already have that: http://logofontandlettering.com/kernking.html
  • Exactly Georg, it's all relative. That's why focusing too closely on individual pairs is problematic.
  • Thomas Phinney
    Thomas Phinney Posts: 2,883
    The problem of combinations such as T.T and L’A is one that can be addressed by never kerning more than half the advance width of the punctuation character.

    This assumes that the TT and LA combinations themselves neither require negative kerning in your font, nor do they have any space left to spare. Depending on how you do sidebearings on such characters, you might have to adjust this advice slightly one way or the other.

    The other option would be contextual kerning, a.k.a. kerning triplets.
  • PabloImpallari
    PabloImpallari Posts: 806
    edited July 2016
    Kent Lew said:
    The danger with trying to have a concise list with only many compounded kerning pairs is that is it equally contrived and can lead to distorted results in the opposite direction.
    Yes. 100% Agree.
    Maybe I can also make a list of words without any kerning pairs (words that should relay only on spacing) and then both list can be mixed, alternating on each row: one having lots of pairs, one having none, one having lots of pairs, one having none...
  • Nick Shinn
    Nick Shinn Posts: 2,207
    Pablo, why not reduce the sidebearings of /r, /v and /w, and have zero kern pairs in [overcrowd]? 


  • PabloImpallari
    PabloImpallari Posts: 806
    edited July 2016
    Nick, those pairs are not my own invention. They where present on more than 75% of the 400 analyzed kerning tables. They may not be needed for a particular typeface, but in general they seem to be pretty popular pairs.
  • Nick Shinn
    Nick Shinn Posts: 2,207
    Yes, but should we encourage this behaviour?
  • PabloImpallari
    PabloImpallari Posts: 806
    edited July 2016
    Yes, /r /v and /w to rounds needs kern in most cases, they are valid pairs.

    Anyway... you may want to kern it or not... but I do want to have it in my word list, so I can test it.
  • Simon Cozens
    Simon Cozens Posts: 740
    I'm now a little confused about what we're testing here. @PabloImpallari, it looks like you have a script that finds max consecutive kerning pairs from an English dictionary given a generic list of kern pairs. But why is a generic list useful? The idea that "overcrowd" contains 6 kerning pairs depends entirely on what your font does.

    Wouldn't it be more useful to do what James suggested and just list the words which have the kern pairs defined in a given font?
  • Kent Lew
    Kent Lew Posts: 937
    just list the words which have the kern pairs defined in a given font?
    That might be useful at some stage of proofing, but it doesn’t give one the opportunity to discover pairs that are not currently kerned but may need to be (or may require sidebearings to be reevaluated, at least).

    The point is that letter combinations — in all manner of possible combinations — need to look [acceptably] even in words. Whether that requires a lot of kerning or not may be a matter of some taste and technique.
  • Ben Blom
    Ben Blom Posts: 250
    edited July 2016
    Nick’s example of the old Bitstream font, illustrates an important, more general point.
    NOTE - This point is only relevant for those who believe that automatically creating the metrics of a font, is an acceptable way of doing that—i.e., the creation of the metrics of a font, does not have to be considered as the result of the “creativity of an artist”, but can be considered as the result of a “parameterized technical optimization process”. After automatically creating the sidebearings and kerning of a font, a “creative artist” always can, if needed, manually change the results of this. (Automatically creating sidebearings, and automatically creating kerning, are here both considered to be end-of-pipe activities.)

    If one tries to automate the creation of the kerning, and forgets about the sidebearings—one is putting the cart before the horse. The best way to automate the creation of the kerning, is by first automatically creating the sidebearings in such a way, that the needed number of kern pairs will be minimal. After creating such optimized sidebearings—automatically creating kern pairs, will result in a minimal (optimal) number of kern pairs.

    So, first and foremost, the Holy Grail of automatically creating the metrics of a font, is automatically creating the optimized sidebearings of a font. 
  • Khaled Hosny
    Khaled Hosny Posts: 289
    Not Latin here, but in Arabic there few kerning pairs needed since most letters join each other, and for the few letters that don’t most old Arabic fonts give them -ve side bearing and be done with it without kerning at all.. I have found this trick useful, and though I do have few kerning corrections in my fonts, they are reserved to pathological cases.
  • John Hudson
    John Hudson Posts: 3,186
    edited July 2016
    The idea that "overcrowd" contains 6 kerning pairs depends entirely on what your font does.

    I interpret what Pablo is doing in terms of potential kerning pairs, based on the presence of shape combinations that are other than straight-to-straight, round-to-round, or straight-to-round. The point isn't that these combinations must be kerned, or that there isn't some other way of ensuring that the result is a nicely spaced word. They are words that expose particular kinds of shape combinations in complex contexts, so are a good test for any spacing approach.
  • PabloImpallari
    PabloImpallari Posts: 806
    edited July 2016
    Thanks John, you've expressed it better than me.
  • PabloImpallari
    PabloImpallari Posts: 806
    edited July 2016
    Ok, so.. basically there is disagreement on the ideal "seed" pairs to create the word list.

    We all can agree basic that pairs like "LT" should be kerned, an pairs like "HH" should not. But other pairs fails in a grey area that depends on the spacing strategy, personal preference, typeface style, etc... Some people kern "oo" (Hi Adobe Garamond Premier!)... others think it's a deadly sin... looks like there is no consensus.

    Keeping that in mind:
    Option 1) Try to reach some kind of consensus creating the seed pairs list. A dead end.
    Option 2) Instead of compiling a predefined list of pairs and a predefined list of words, it should be a customizable tool: It should let the users define the list of "seed" pairs instead of using a predefined set. This way each one of you will be able to define the kerning pairs of your preference, and generate custom words lists. Will that be ok?
  • PabloImpallari
    PabloImpallari Posts: 806
    edited September 2016
    A quick update on the new Contextual Kerning Tool:

    After you feed your font's kerning table into the tool, it will give you a nice customized "birds-eye visualization" on what you have kerned and what you have not.

    It will also split the dictionary into heavily kerned words (those having 5 or more pairs each) and words than are resolved using spacing only. This words are also customized according to each font kerning pairs.

    So, the tool is not doing any assumption about your kerning strategy.
    It's only role is to assist you, so you gain more control over your own process.

    It's still a very early prototype, so thing may change in the future. Also: It's a web based tool, so you need to export your font's kerning using a macro and upload it to the server and configure a few Php files (this is the most tedious part) but hopefully someone can steal mi idea and turn it into a plugin for Glyphs, Fontlab, Robofont, etc.. or maybe it can be possible to just drag the font into the app and have some magic javascript reading the kerning table on the fly (this is technically possible but out of my programming abilities)

    Attached some screenshots:




  • You can also compare kerning in two versions of the same font, or in two different fonts: