Creating Fonts with Inkscape and FontForge | Part#1
Part#1 - Simple Alphabet
In this tutorial, we create simple font, and introduce core concepts of both Inkscape and FontForge.
-
Creating a new project
- Open FontForge and select
new - Go to
Element|FontInfo. - Double click
Fontnameto select it and type "Font#1" (all the names should change) then validateOK - Do
File|Save as...and save the file in a directory (such as " .../Font#1/Font#1.sfd ")
- Open FontForge and select
-
Drawing the glyphs
- setup
- Open Inkscape to create a new document and save it in the same folder as the .sfd file
- Open
File|Document properties|Page. In the boxCustom sizesetUnits=px, Width=500, Height=500. - Open
File|Document properties|Gridsand create a new rectangular grid withSpacingX=25, SpacingY=25 - Close
Document properties
- drawing
- Read this guide on how to pan and zoom in Inkscape.
- Draw a
Rectangle (F4)in the background like this, it will be your baseline. You can remove it's border by right-clickFill and stroke|Stroke Paintand click the cross. To change the color to a light transparent one,Fill and stroke|Fillchange it's opacity and use the color wheel. - Using the
Draw Bezier (Shift+F6)tool in mode Bezier Path, draw some simple letters. - Once the shapes of your letters are closed, color them by adding a Fill color (flat color). Here's what they might look like. If your letters are made of multiple shapes, select them by holding
shiftand combine them withPath|Union. - The last thing to do before importing the glyphs is to remove their stroke. Select them and do:
right-click|Fill and stroke|Stroke Paint->click the cross.
- setup
-
Importing the letters in FontForge
-
In FontForge go to
Element|Font Info...|General. -
Set
Ascent=325,Descent=175,Em Size=500This is what Ascent and Descent corresponds to : picture. Em Size is the sum of the two, you can read more about em-sizes here.
-
Try copying a glyph and pasting it in an empty cell in FontForge. It will appear in the top left hand corner like this. You can select all the points and drag the letter back onto the baseline.
Tip: If you had done precise positioning in Inkscape and don't want to lose it, copy the letter AND a small rectangle like this before copy pasting it, then delete the rectangle from FontForge and voila!
-
Copy all the letters into FontForge : picture.
Tip: There seems to be a bug where, upon copying something inside of FontForge, it sometimes becomes impossible to paste anything from Inkscape afterwards. If this happens to you, closing and reopening FontForge should fix this.
-
-
Set the bearings
- There are two ways to do this. Open each glyph and manually drag the two vertical bars close to the letter like this.
- You can type the name of other letters in the text box to preview them together and choose the ideal spacing. Simply click the letter you want to edit on the screen.
- An automated way of doing this is to select multiple letters, and choose
Metrics|Set both bearingsset both bearings to 20. If you had precise positioning going on, this might break it.
-
The glyph "space"
- The last thing to do is create the glyph for "space" (Hexadecimal number 0x20). Select the empty glyph and
Metrics|SetWidthto 100.
- The last thing to do is create the glyph for "space" (Hexadecimal number 0x20). Select the empty glyph and
-
Generate the font
-
Do
File|Generate Fonts...as " Font#1.ttf " in TrueType OR " Font#1.otf " in Opentype (CFF). Options should be set toHints+FlexHints+TrueTypeHints+Opentype+PSGlyphNames+LookupNames.If you checked
validate before savingYou will get an error "Non standard Em-Size", standard sizes are 1000, 1024 and 2048. The first is a convention, while the other two are linked to another error you will get : "Non Integral coordinates." In order to save space and reduce file sizes, it is common to round all coordinates to integers, hence the standard 1024 and 2048 sizes being powers of two. You can forget about these errors andgenerateanyway. -
Install the font, and preview in Libreoffice Writer. Other software may not support all the features our fonts will be using in other tutorials. (PS: You may need to delete the font before installing it, if you already installed it once before).
-
Posted Mar 1, 2018, 7:56 PM UTC · edited