To Kern or Not to Kern?

That is indeed a sixty-four thousand dollar question.

But first, just in case you do not know about kerning, a quick explanation:

Kerning is a mechanism that professional fonts use to adjust the amount of space between letters in order to give a more visually pleasing look to words.

The Custom Font example used below shows how the same word looks with and without custom font kerning. The effect on the gap between the letter ‘A’ and the letter ‘S’ is quite dramatic; the effect on the gap between the letter ‘W’ and the letter ‘A’, however, is much more subtle.

It is up to you, as the Custom Font creator, to decide whether to add some kerning but, if you only intend to use the Custom Font once or for a short caption, it may not be worth the effort. My Custom Font filter called FontSlab, for painting the characters on screen, has two options for adjusting letter spacing.

You can use the ‘Adjust spacing between characters’ option to reduce or increase the gap between all the letters in every word.

If you set the ‘Retain layers’ option to ‘Yes’ then every character will appear as a separate layer and you can then re-position individual letters using the Move tool in Gimp.

This guide however will show you how to add kerning information to Custom Fonts which will be applied automatically when you use my filter in Gimp.

The first thing to do is to look at your characters and make an assessment of which ones, if any, would benefit from any added kerning. Traditionally, certain letter combinations such as ‘AW’ and ‘To’ can be improved and a quick look at a set of letters (displayed using FontSlab for instance) will help to identify any major issues.

Create a new image in Gimp with enough width to cope with a capital letter test – to at least one thousand pixels – using.

File>>New… or Ctrl + N

Use the Path tool to add two points to your new image to create a simple path.

Created with GIMP

Open the FontSlab dialog:

Filters>>Custom Font Tools>>FontSlab

Set ‘Match text size to the length of the path:’ to ‘Yes’ and type all the capital letters into the ‘Text:’ field. Click on the ‘.xcf font file’ and locate the Custom Font you wish to add kerning to. Finally set ‘Use custom font’ to ‘Yes’ and click on ‘OK’.

Since all fonts are different I will have to refer to the one I converted into layers or character images but you can easily apply these methods to your own Custom Fonts, if they require kerning.

It was quite obvious which of the letters in this font were going to cause problems when viewed on-screen. The ‘G’, ‘K’, ‘Q’ and ‘R’ would need to be moved closer to letters on their right-hand side and the ‘S’ and ‘Y’ would need to be moved closer to letters on their left. Sloping letters like ‘A’ would probably need to moved closer to other sloping letters such as ‘V’ and ‘W’ and any upper-case letters that over-hang small, lower-case letters such as ‘T’ with ‘o’ would also probably need moving closer together. The decision to add kerning is yours alone.

If you do decide to kern I strongly advise you to do so before applying any special effects to your Custom Font. If you have saved a plain version of your work the kerning path information will also be saved to any further copies or modifications that you later make – it is quicker and easier to delete than to copy from one file to another (I speak from personal experience).

Adding Global Kerning Paths

Global kerning information should be used when you want to alter the amount of space between a letter and all the other characters. This kerning information takes the form of a simple path, added to the custom font file, with the name of the character followed by ‘.png’.

A closer look at the upper-case ‘G’ in my particular Custom Font shows that part of the letter is actually meant to sit below the font baseline (the imaginary line that all capital letters would stand on).

With the Custom Font file open in Gimp, and the ‘G’ character visible, I used the Path tool to add two points to mark the new width to use for the kerning path for this letter.

I then had to rename the path, in the path layer dock, from Gimp’s default name of ‘unnamed’ to ‘G.png’ – by clicking on the name and entering the new one. As soon as the Custom Font file is re-saved this new kerning information is available for other filters, like FontSlab, to make use of.

I applied this method to all the other characters in this group and then moved on to the letters ‘Y’ and ‘S’. These characters require the use of some form of ‘negative kerning’ to move them closer to any letter placed before them.

The method that I have adopted is to add a path as wide as the character (take into account any letters that also may need some kerning on the right-hand boundary); then move the whole path to the left of the character by the amount you wish to kern. This all sounds much more complicated than it is.

The larger view below shows the problem with the capital ‘Y’ more clearly.

As with the previous kerning example, I added a two point path with only that character layer visible in the Custom Font file in Gimp. (Make the path visible in the path dock or you will not be able to see it when you change tools.)

Then I double-clicked on the Move tool and used the third option in the Move dialog to apply the tool to paths (the default is to move layers).

I moved my cursor over the path and clicked and held down the mouse button to move the path to its new position. (You may need to zoom out in order to ‘see’ enough space around the character to gauge the amount of move.)

Remember to re-name the new path (in this case as Y.png) and to save your work again.

Now the character should be displayed more satisfactorily with the FontSlab filter in Gimp:

I tackled the letter ‘S’ in the same way and then thought about adding some ‘local kerning’ information to one or two characters.

Adding Local Kerning Paths

This type of kerning only applies to pairs of letters so you need to make one path for each pair. This kerning information takes precedence over any global kerning and is denoted by its path name – just the two characters involved e.g. a path named ‘AW’.

I made the first character visible in the Custom Font file and added a new path for the letter pair – making it slightly smaller than the width of the character layer – before re-naming it as ‘AW’. I then repeated the process for the ‘WA’ pair.

A view of the paths in my path tool dock showing global and local kerning path names (the order is not important):

A larger view of the unkerned and kerned character pairs:

That’s about all there is to kerning your Custom Fonts. Some fonts, especially square-faced and monotype fonts require little or no kerning. Most look better for a little kerning if you can apply it. Some Custom Fonts, like those with swashed capitals, would not be worth doing without taking extreme measures. The Custom Font shown below has 110 characters and more than 300 kerning paths – and probably could do with more. One day, perhaps… …maybe… …you never know!

Leave a Reply

1 Comment threads
0 Thread replies
Most reacted comment
Hottest comment thread
1 Comment authors
Pat625 Recent comment authors
newest oldest most voted
Notify of

I applaud Skinnyhouse for his continued efforts to make the procedures used for creating Custom Gimp Fonts. The above Tutorial is very well organized, easy to read, and has examples for us to connect to the written information.