It is currently 05 Jun 2020, 22:06

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Social:  Say Hello | Anything Goes | Shares | FCSP

Custom Font Kerning Tools (Updated to version 0.02)

Share your Python Fu Scripts/plug-ins for GIMP here
Post Reply
Script Coder

Custom Font Kerning Tools (Updated to version 0.02)

Post#1 by skinnyhouse » 08 Oct 2019, 14:26

Kerning Utility Filters
(78.92 KiB) Downloaded 48 times
A bug-fix for Lower-case and Upper-case to lower-case filters that did not take account of negative inputs with letter groups. The affected filters are denoted as versions 0.02b.
Kerning Utility Filters
(78.81 KiB) Downloaded 42 times
Update to the kerning utilities to create paths with .png. See later post for details
Edited 18/10/2019
Kerning Utility
(34.47 KiB) Downloaded 54 times
The zipped folder contains four plug-ins. Three of the filters are for creating kerning paths to go with custom fonts and the other is for creating kerning paths for non-English accented characters.

Download and unzip them and install them to your plug-in folder.

The instructions are also available as a pdf
Kerning Utility Help.pdf
(458.37 KiB) Downloaded 54 times

Basically there is no simplistic solution and it may well be that folk decide that it is just not worth the effort. If, however, you want to have a go at kerning this set of utilities may be of use; they may at least help by acting as a starting point for adding kerning paths to a custom font.

To avoid one humongously long filter dialog I have split the kerning process into three filters – one to create kerning paths for use with upper-case letters, one for lower-case letters and one for upper-case to lower-case letters. There is also a tool for duplicating existing kerning paths for non-English languages – i.e. for Spanish, French, German and Italian accented characters.
01_menu_tree.png (23.89 KiB) Viewed 2110 times
The path creation tools all share an almost identical filter dialog interface.

This colour-coded version of the filter dialog for the upper-case kerning paths illustrates the types of options available.
02_UC_dialog.png (67.22 KiB) Viewed 2110 times
The red bordered items provide options for creating and adjusting the width of kerning paths.

The yellow bordered items provide options for displaying kerning letter pairs for a saved custom font file.

The green bordered item provides an option to finalize the kerning paths by removing any paths which are the same width as their parent characters – thus reducing the file size of the custom font.

My example for this help guide uses a plain white custom font based on a font called ‘Caraway’.

There is an option to change the colour of the background should this be necessary.

The workflow for creating the kerning paths is as follows:
Decide on a kerning style
Create initial kerning paths
Adjust the kerning paths as required
Finalize the paths

IMPORTANT: The filter kerning option when applied to all letters removes existing kerning paths of the same type before creating new ones; so please make sure that you work on a copy of your custom font and not on the original version.

Part 1: Deciding on a kerning style

The first thing to do is to look at the available style options and decide which one will eventually produce the best results with this custom font.

Open the custom font and call up the filter dialog from the menu path:

Filters>>Custom Font Tools>>Kerning Tools>>Custom Font Kerning for Uppercase

Please note that to display kerning pairs the filter requires another of my filters - FontSlab version 0.11 – to be installed.

There are two options available for displaying samples of the currently saved version of the custom font. You can opt to display a sentence (or replace it with your own) or to display all of the kerning pairs available for a single letter. (You can display all 26 letter pairings in one go but please be aware that this does take quite a long time – go and have a coffee while you wait for this operation to finish.)

Set the ‘Select one current kerning example’ option to ‘Yes’ and choose a letter to display from the drop-down ‘Select kerning for’ option. Click on ‘OK’ to display the letter pairs for that character (opens in a new image display). Since no kerning paths exist yet the pairs will all be displayed with reduced opacity – but this allows you to note any potential kerning issues e.g. ‘A’ with ‘T’, ‘V’ and ‘W’.
03_A_No_Paths.png (49.12 KiB) Viewed 2110 times
Set the ‘Select one current kerning example’ option to ‘No’.

Part 2: Creating Kerning Paths

To see the effects of applying one of the kerning styles set the following options:

‘Create uppercase kerning paths for custom font’ to ‘Yes’
‘Kerning style used’ to ‘Common pairs’
‘Apply kerning to’ to ‘All letters’

Click on the filter dialog ‘OK’ button

This will create a number of kerning paths (426 of them) but you will first have to re-save the custom font before you can view the results.

Once saved bring up the filter dialog again and set the following options:

‘Create uppercase kerning paths for custom font’ to ‘No’
‘Select one current kerning example’ option to ‘Yes’
‘Select kerning for’ option to the letter you wish to view (‘A’ in my example).

This creates kerning paths for the commonly used letter pairs (for English) and will allow us to view those pairs with full opacity set. This employs the left and right letter spacings that the font designer used originally.
04_A_CommonPairs.png (58.56 KiB) Viewed 2110 times
This set of kerning paths can be adjusted if requires. There are are two other sets of kerning styles that may form a better starting point for fine tuning – based on ‘Sans Serif’ style and ‘Serif’ style. If you use the ‘Apply kerning to’ option with single letters you can mix and match the kerning paths from the available styles; just remember to save the custom font file as you go along.

For the sake of comparison here is what the ‘Sans Serif’ style looked like…
05_A_Sans_Pairs.png (56.59 KiB) Viewed 2110 times
...and the ‘Serif’ style.
06_S_Serif_Pairs.png (56.63 KiB) Viewed 2110 times
The differences can often be quite subtle but if you compare the latter two with the first image you can see that attempts have been made to resolve some of the issues e.g. ‘AV’ - but other problem pairs have been created. It very much depends on what the original designer used for the font letter margins.

To recap; the kerning styles available are:
‘Use kerning paths if available’ allows us to adjust existing kerning paths
‘Common pairs’ creates kerning paths for the most used letter combinations (English)
‘Sans Serif’ creates kerning paths based on an Arial style font
‘Serif’ creates kerning paths based on a ‘Times Roman’ style font
‘All pairs’ creates a full set of kerning paths (676 in total)

The next stage in the process is to examine each letter in turn and note any consistently problematic kerning pairs – whether the letters are are too close or too far apart.

Part 3: Adjusting kerning path values

In this section of the guide I have used the same ‘Caraway’ custom font with ‘Custom pairs’ kerning style paths already added (and saved) as the starting point for fine tuning this kerning information. (The values used are the percentage of the width of the first character in the kerning pair.)

Set ‘Kerning style used’ option to ‘Use kerning paths if available’.
Set ‘Apply kerning’ to ‘A’.

For the kerning pairs beginning with ‘A’ the following adjustment values were used:
07_A_Adjust.png (32.07 KiB) Viewed 2110 times
This produced the results shown below.
08_A_Adjust_Result.png (58.66 KiB) Viewed 2110 times
If you run the filter again with ‘Use kerning paths if available’, it will adjust the values again by the same amounts and if you use ‘Apply kerning to’ with ‘All letters’ then every upper-case letter will be changed by that value.

The other kerning styles do not alter the values incrementally.

Move on to the next character and repeat the process of viewing the current kerning effect and altering values where appropriate. The kerning pairs for ‘B’ needed no adjustment (yippee) so I moved on.

Here are the values entered for the letter ‘C’.
09_C_Adjust.png (31.92 KiB) Viewed 2110 times
The results (with the original values on the left) can be compared below.
10_C_Result.png (40.19 KiB) Viewed 2110 times
This procedure needs to be repeated for all of the capital letters.
Some would say ‘tedious’ – but I would say, not as tedious as attempting to create each individual kerning path with the path tool.

Part 4: Finalizing kerning paths

Use this option when you have finished creating and adjusting the kerning paths for the letters.

During the kerning process some of the paths may end up being the same width as their character layer (the filter cannot display kerning pairs without kerning paths).

Once the process is finished this option can be used to remove these unnecessary paths and reduce the file-size of the custom font.

If the custom font has lower-case letters you may wish to use the other kerning filters. They work in exactly the same way and contain only minor differences in their respective filter dialogs.

Part 5: Things don’t appear to work

Error dialogs will be shown if the FontSlab filter cannot be found. If nothing happens, or Gimp error messages appear, it may just be that you have not called the filter directly from the image with the custom font file - but from one of the kerning display images: I have lost count of the number times I have done this myself.

Custom Font Accented Character Utility

This small plug-in simply will create a kerning path for French, German, Italian and Spanish accented characters if the custom font already contains the accented character and there is an existing kerning path for the English kerning pair.

So, for example, if the filter finds a character layer called ‘Á.png’ and two paths named ‘At’ and ‘As’ it will create two more paths called ‘Át’ and ‘Ás’ by making copies of the original paths.
11_Accents.png (36.06 KiB) Viewed 2110 times

Edit: Sorry I uploaded an old version file by mistake for the upper-case kerning path utility. All now as it should have been. Please download and replace if you were affected. :hammer_head:
Last edited by skinnyhouse on 22 Oct 2019, 19:47, edited 4 times in total.

Script Tester

Post#2 by Issabella » 08 Oct 2019, 15:48

OH My God! Skinnyhouse how hard you have worked to create this tool for getting more perfection in Custom Fonts Results.
I know that to assimilate it will take me loooooonnng time, for sure. Thank you so much for your work and effort, too. :gimp_clap: :gimp_clap: :gimp_clap:

Don’t be afraid to start over. It’s a new chance to rebuild what you want.

Script Coder

Post#3 by skinnyhouse » 09 Oct 2019, 13:37

Edited attachment to original post due to an uploading error to one of the filters on my part. All should now work as intended.

Tutorial Creator

Post#4 by Pat625 » 09 Oct 2019, 15:31

I agree with Issabella! Skinnyhouse, you must have great talent and patience to do such a tedious task. As Issabella stated, I wiil need to study this before I attempt its use. Thank you for your time and effort to complete this humongous task!

Script Coder

Post#5 by skinnyhouse » 10 Oct 2019, 12:58

Thank you Pat and Issa...

Script Coder

Post#6 by skinnyhouse » 10 Oct 2019, 13:07

An example of using the kerning utility...

I worked on a capital only font using the Upper-case Kerning filter and then used a WallpaperCave image to decorate the font (with and without kerning paths).

After finalizing the kerning the file had 132 kerning paths (425 without finalizing).

First the text without kerning paths:
Pumpkin_Wow_Unkerned.jpg (149.92 KiB) Viewed 2059 times
And then with kerning:
Pumpkin_Wow_kerned.jpg (149.49 KiB) Viewed 2059 times
Note the better spacing in 'WOW' and 'WAY'.

Script Coder

Post#7 by skinnyhouse » 18 Oct 2019, 07:10

Kerning Tools Updated to version 0.02

I have updated each of the kerning tools to version 0.02. The filter dialogs remain the same but the tools now generate kerning paths with the .png extension; thus making them compatible with other custom font writing filters.

I have also put a copy of FontSlab v.0.12 and the Layer Utilities filter v.1.20 in the zipped folder with the kerning utilities.

To use this version of the kerning tools users will still need to have FontSlab installed in their plug-in folder. I have updated FontSlab to version 0.12 (this version can use both types of kerning paths).

I have also updated the Layer Utilities filter to version 1.20 and added a new option for removing paths from a custom font file. The option for adding a string to a single letter path name now works with two character kerning paths.
Layers_Utils_dialog_120.jpg (82.16 KiB) Viewed 1999 times

GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply
  • Similar Topics
    Last post

Who is online

Users browsing this forum: No registered users and 10 guests