39
8
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?
39
8
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?
44
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.
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
.
The missing glyphs should be added in a few moments:
Finally, do File -> Generate Fonts
and export your font to a desired location.
2
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.
I have hundreds of ttf files to merge. Is there a command-line for that? – user2284570 – 2014-10-22T20:26:46.090
https://gist.github.com/iegik/47b61b41d3c2a1f3fbb4#file-sfddiff-sh – iegik – 2015-02-11T10:52:33.640
2This seems to only work if the fonts are of a similar em height, otherwise the glyphs get all funky. – Hanna – 2017-12-12T00:39:19.920
Is there a way to do this for specific glyphs only? – Khalid Hussain – 2018-10-05T18:53:45.333
FontForge has python based scripting to automate many tasks. But I would have been nice to see a more detailed and updated answer.
– not2qubit – 2018-12-09T19:23:12.793Could you explain why we would most likely not want to preserve kerning? I – Maarten – 2019-06-10T11:03:44.427
1@Maarten I probably figured that one out by trial-and-error, but no, I can't really. It's been 7 years! – dset0x – 2019-06-10T16:39:13.333
1I merged missing font and it looks normal in Fontforge but it made the fonts microscopic at a normal font size. Is there an explanation? I thought Kerning is spacing, no horizontal height. – Jon Weinraub – 2019-06-10T20:33:22.167
1Before 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 – 2019-11-20T13:35:52.100
Thanks @Cristan. Added in the answer. I sure had a yucky-colored wallpaper in 2012. – dset0x – 2019-11-28T18:28:18.807
@Hanna you might also be interested in Cristan's comment. – dset0x – 2019-11-28T18:28:41.153