This tutorial will show you how to create ligature substitution lookup tables in Fontforge, via ‘Font Info’.
- We’ll start with a brief outline of definitions.
- Followed by adding a new encoding slot so that we can create and build the ‘fi’ ligature.
- Then we’ll add a single substitution lookup table, using ‘Font Info’.
- Next we’ll type ‘fi’ in ‘Metrics View’ to check whether our ligature table works.
- 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|
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.
To add a new encoding slot, make sure you’re in ‘Font View’ then,
a) Click on ‘Encoding>Add Encoding Slots’.
On the next screen that pops ups,
a) Insert the number of encoding slots to add.
b) Then click ‘OK’.
The new encoding slot will be added to the end and right at the bottom of ‘Font View’.
Now we need to name our new encoding slot.
Click on the new encoding slot glyph cell,
a) then right click
b) Select ‘Glyph Info’
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:
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 ( _ ).
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.
Now that we’ve named our new encoding slot, we need to build a composite glyph that will go into the new encoding slot.
Make sure the new encoding slot you created, is selected, then
a) Click ‘Element>Build>Build Composite Glyph’.
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.
After clicking ‘Element>Build>Build Composite Glyph’ your glyph cell should now be filled with two (2) glyphs, ready for editing.
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’.
To unlink them, make sure your new encoding slot is still selected, then;
a) Click ‘Edit>Unlink Reference’.
Your new encoding slot glyphs are now independent to your base glyphs and ready for editing, removing overlaps and adjusting the caret.
Once you’ve finished editing, removing overlaps and adjusting the caret, we can move on to adding the ligature substitution lookup table.
Next we need to create a Ligature Substitution Lookup Table to describe our changes.
Make sure you’re in ‘Font View’ then,
a) Click on ‘Element>Font Info’.
On the next screen that pops up, make sure you’ve selected ‘Lookups’ in the left hand column, then
a) click on ‘Add Lookup’.
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.
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.
When you do see the long drop down list,
a) Select ‘liga Standard Ligatures’.
The ‘Lookup Name’ will now be auto populated and a ‘liga’ will be added to the feature column.
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’.
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.
- 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.
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.
Now we’ll need to type the name of our ligature, into the left hand column.
a) In this example I’ll enter:
b) Remember to separate each glyph with an underscore (_).
Then in the right hand column, type the name of the source glyphs.
a) In this example I’ll enter:
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’.
e) Click ‘OK’ again to commit and save our ligature substitution lookup table.
- We have now completed the ligature substitution lookup table and you should be back in ‘Font View’ ready for testing our ligature table.
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’.
Congratulations on making it to the end and creating your ligature lookup table.
- 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.