Jay Taylor's notes

back to listing index

Create a new TrueType font using a subset of characters from an existing TrueType font - Unify Community Wiki

[web search]
Original source (wiki.unity3d.com)
Tags: howto font wiki.unity3d.com
Clipped on: 2016-04-30

Create a new TrueType font using a subset of characters from an existing TrueType font

So, Arial Unicode MS has all the characters you need ... but importing it generates a 16MB file!

Wouldn't it be nice to extract only those symbols/characters you need?


Requirements:

1. Download and install FontForge
2. Get a unicode font, e.g. Arial Unicode MS. The ArialUni.ttf font can be found in Windows in C:\WINDOWS\Font


How to extract a specific sub range of characters:

1. Open the font in FontForge

2. Select the Unicode subrange you want by going to Edit->Select->Select by Script.
i) In the pop up window select the range you want and press the OK button.
Note: Unless you are already looking at the specific subrange you won't notice that they have been highlighted in yellow.

3. Add the space character to your selection - hold down shift and left click on Unicode char U+0020 (ASCII 32 - just to the left of the exclamation mark char). It should be highlighted in yellow.

4. Invert your selection by going to Edit->Select->Invert Selection

5. Remove these unwanted symbols by going to Encoding->Detach & Remove Glyphs. This may take some time - but when it is finished you will notice that all the highlighted font cells have now been crossed out.

Operation in progress example (this may take sometime, try not to touch anything FontForge can be a bit unstable):
Image (Asset 1/7) alt=

Operation complete example, all the selected symbols have been replaced with crosses:
Image (Asset 2/7) alt=

You may find some of your character cells have blue in them, I don't know what this means but it has not caused me any problems:
Image (Asset 3/7) alt=

6. Compact your new font to only the useable symbols by going to Encoding->Compact.
Compacted font example:
Image (Asset 4/7) alt=

7. Generate the TTF font by going to File->Generate Fonts.
The only option I change is the export type to TrueType.
Image (Asset 5/7) alt=
8. Import into Unity, sacrifice something to the God of FontForge and enjoy.

  • Image (Asset 6/7) alt=
  • Image (Asset 7/7) alt=