How to Create Ligature Substitution Lookup Tables in Fontforge

This tutorial will show you how to create ligature substitution lookup tables in Fontforge, via ‘Font Info’.


How this Tutorial Is Organized

  1. We’ll start with a brief outline of definitions.
  2. Followed by adding a new encoding slot so that we can create and build the ‘fi’ ligature.
  3. Then we’ll add a single substitution lookup table, using ‘Font Info’.
  4. Next we’ll type ‘fi’ in ‘Metrics View’ to check whether our ligature table works.
  5. To finish off, I’ll provide tips in case your ligature lookup table may not be working.

i. You can download Fontforge for Windows, Mac, or Linux from here.
ii. The font used in this tutorial is called Playball. It’s a free font for personal and commercial use with an open source license.
iii. This tutorial is shown on a Windows 10 computer with Fontforge version 03142020.
iv. Fontforge does crash, so save often.
v. Detailed information on lookup tables can be found at Fontforge.


This is ‘Font View’


Title Meaning Also Known As
Single Substitution Lookup Table It’s a table you create when you want to replace a single glyph with another single glyph. Lookup, Lookup table, Substitution Lookup, Single Substitution Lookup
Subtable Every lookup table has one or more subtables that defines what glyph will replace another glyph. Lookup subtable, Substitution subtable, Single substitution lookup subtable

Adding A New Encoding Slot

  1. For this tutorial we’ll be adding a new encoding slot for the ‘fi’ ligature, however you can also,
    a) use one of the Private Use Area (PUA) Unicode slots which start at E000,
    b) use one of the Unicode slots for ligatures at FB00, or
    c) use an existing Unicode slot.

  2. To add a new encoding slot, make sure you’re in ‘Font View’ then,
    a) Click on ‘Encoding>Add Encoding Slots’.


  3. On the next screen that pops ups,
    a) Insert the number of encoding slots to add.
    b) Then click ‘OK’.

  4. The new encoding slot will be added to the end and right at the bottom of ‘Font View’.

Naming Your New Encoding Slot

  1. Now we need to name our new encoding slot.

  2. Click on the new encoding slot glyph cell,
    a) then right click
    b) Select ‘Glyph Info’

  3. On the next screen, make sure ‘Unicode’ is selected in the left hand column then,
    a) In the box next to ‘Glyph Name’, manually type in the name of your glyph.
    In this example we’ll be typing: f_i

  4. Note it is standard practice for ligatures to have an underscore ( _ ) separating glyphs, although Fontforge seems to recognize either; an underscore (f_i) or, no underscore (fi) for the output fi.
    a) For this tutorial, we’ll be using an underscore ( _ ).

  5. Once you’ve named your new encoding slot,
    a) Click ‘OK’, to take you back to ‘Font View’.

For a detailed explanation on completing all the fields in the Glyph Info dialogue box, visit Fontforge’s userguide.

Building Your Composite Glyph

Now that we’ve named our new encoding slot, we need to build a composite glyph that will go into the new encoding slot.

  1. Make sure the new encoding slot you created, is selected, then
    a) Click ‘Element>Build>Build Composite Glyph’.

  2. Note if you find that your ‘Element>Build’ is grayed out, it means that Fontforge is not yet able to recognize what glyphs it should use to build your composite glyph.
    a) In other words, you need to add a ligature substitution lookup table first, then come back and you’ll be able to access ‘Element>Build’ to complete this step.

  3. After clicking ‘Element>Build>Build Composite Glyph’ your glyph cell should now be filled with two (2) glyphs, ready for editing.

  4. Before we edit the glyphs in this cell, we need to ‘unlink’ them from their source, otherwise any changes we make to the glyphs within the new encoding slot, will change the source glyphs.

    a) Note: Linked glyphs or references will display a character above the glyph in ‘character view’. You can get to ‘character view’ by double clicking a glyph cell from ‘Font View’.

  5. To unlink them, make sure your new encoding slot is still selected, then;
    a) Click ‘Edit>Unlink Reference’.

  6. Your new encoding slot glyphs are now independent to your base glyphs and ready for editing, removing overlaps and adjusting the caret.

  7. Once you’ve finished editing, removing overlaps and adjusting the caret, we can move on to adding the ligature substitution lookup table.

Adding A Ligature Substitution Lookup Table

Next we need to create a Ligature Substitution Lookup Table to describe our changes.

  1. Make sure you’re in ‘Font View’ then,
    a) Click on ‘Element>Font Info’.

  2. On the next screen that pops up, make sure you’ve selected ‘Lookups’ in the left hand column, then
    a) click on ‘Add Lookup’.

  3. When the ‘Lookup’ dialogue box pops up,
    a) Select ‘Ligature Substitution’ from the drop down list at the top, next to the word ‘Type:’.
    b) Now click on the little button next to <New> to add a new line, which should also trigger a drop down list.

  4. If you clicked on ‘<New>’ instead of the little button, you can either;
    a) Delete the line and start again, or
    b) you need to first click into the right hand column (1) blue area, then click into the left hand blue area (2), then
    c) click on the little down button (3) in the left hand blue area to access the drop down list.

  5. When you do see the long drop down list,
    a) Select ‘liga Standard Ligatures’.

  6. The ‘Lookup Name’ will now be auto populated and a ‘liga’ will be added to the feature column.

  7. In the box next to ‘Lookup Name’, you can either keep the default name or change it.
    a) In this example I’m going to change it to ‘liga’.

  8. Now go ahead and,
    a) untick ‘Store ligature data in AFM files, and
    b) click ‘OK.’

Now that we’ve added a Ligature Substitution lookup table the next step will be to add a corresponding subtable to it.

Adding a Ligature Substitution Subtable

  1. To add a subtable to our Ligature table,
    a) click on ‘Add Subtable’.
    b) Click ‘OK’ to accept the default name, or you can rename it.
  2. On the next dialogue box that pops up, we’ll associate our substitution glyphs with their default source glyphs by,
    a) clicking on ‘<New>’ to create a new line.

  3. Now we’ll need to type the name of our ligature, into the left hand column.
    a) In this example I’ll enter: f_i
    b) Remember to separate each glyph with an underscore (_).


  4. Then in the right hand column, type the name of the source glyphs.
    a) In this example I’ll enter: f i
    b) If your ligature is made up of more than 1 source glyph, separate them with a ‘space’.

    For example: mpl = m p l

    Our example is: fi = f i

    We will type: f i making sure to separate each glyph with a space. The line should auto populate as you type and with the below example, Fontforge has added ‘(fi)’ to the end.

    c) To view your entries you can hover your mouse over the source glyphs and a pop up will appear.
    d) Click ‘OK’.
    right-column-f i-in-ligature-substitution-subtable-fontforge
    e) Click ‘OK’ again to commit and save our ligature substitution lookup table.

  5. We have now completed the ligature substitution lookup table and you should be back in ‘Font View’ ready for testing our ligature table.

Testing Your Ligature Lookup Table

  1. To test your lookup table, make sure you’re in ‘Font View’ then,
    a) Click ‘Metrics>New Metrics Window’
    b) Type ‘ofid’, or letters of your own choosing, in the text box, and
    c) deselect ‘liga’ by holding down ‘Ctrl’ on your keyboard and left mouse click with your mouse pointer on the word ‘liga’.

  2. Congratulations on making it to the end and creating your ligature lookup table.

It’s Not Working

  1. If you see your ligature changing within the ‘Metrics View’, congratulations, if you don’t, go back and make sure:
    a) you’ve followed the instructions step by step and haven’t skipped a step like ‘build composite glyphs’.
    b) Check spaces and your spelling,
    c) adjust the kerning of your new glyphs,
    d) check that you’ve entered the correct letters in the subtable,
    e) consider saving, closing Fontforge and restarting Fontforge.
    f) ‘Default Using Suffix’ will never work if you’ve used Fontforge’s ‘Mass Glyph Rename’ function. I’ve outlined the reasons why and what to do, to be able to use ‘Default Using Suffix’, here.

That brings us to the end of this tutorial.

I hope this tutorial has been of assistance and you can put some of the information to good use when using Fontforge.