M HYPE SPLASH
// general

Merging two fonts

By Emma Payne

How can I combine two fonts automatically, so glyphs those are not available in the first font, but available in second one can be merged into the first font?

3 Answers

This is an easy task with fontforge.

Addendum from comments: Before merging, click Element > Font info... in both fonts first to see whether the values like em size match. Otherwise, update either to match the values of the other font. This prevents issues like different character sizes. This info should probably be added to the answer. – Cristan

First, you want to open the font with the missing glyphs and select Element -> Merge Fonts. In this example, the glyphs for E and F are the ones missing.Element->Merge Fonts

Select the font from which you want to pull glyphs. You will be asked whether you want to keep the existing kerning; you most likely want to select No here, but if you get strange results close fontforge and try again with Yes.Kerning dialog

The missing glyphs should be added in a few moments:Result in main fontforge window

Finally, do File -> Generate Fonts and export your font to a desired location.

12

Also have a look at Google's Google Noto Font project and their Noto Tools merge_fonts.py script.

Or merge.py from the FontTools project.

For more deep info on making/adding fonts to Windows, look at my other answer here.

  1. Install FontForge
  2. It usually gets installed at C:\Program Files (x86)\FontForgeBuilds\bin, so add that to your path environmental variable(Only for Windows Users).
  3. Paste the below code in a file named mergefonts.ff
#!/usr/local/bin/fontforge
Open($1)
SelectAll()
ScaleToEm(Strtol($3))
Generate("1.ttf")
Close()
Open($2)
SelectAll()
ScaleToEm(Strtol($3))
Generate("2.ttf")
Close()
Open("1.ttf")
MergeFonts("2.ttf")
Generate($4)
Close()
  1. mergefonts.ff Script Usage:
fontforge -lang=ff -script mergefonts.ff <font1> <font2> <font_size_in_em> <output_merged_font>

Example:

fontforge -lang=ff -script mergefonts.ff font1.ttf font2.ttf 1000 mergedfont.ttf

References:
Link1
Link2
Link3

4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy