Merging duplicate glyphs within a font in FontForge?

I use FontForge together with Perl scripting to generate scalable bitmap-like (pixelated) outline TrueType fonts out of pure bitmap font formats like, for example, BDF and Unifoundry’s HEX. TrueType allows multiple characters to share a same common glyph, like for example the HYPHEN “-” glyph being usually mapped to three characters (U+002D HYPHEN-MINUS, U+2010 HYPHEN, & U+2011 NON-BREAKING HYPHEN). However, the same cannot be said of BDF or HEX bitmap fonts, where glyphs like HYPHEN have to be duplicated before they can be assigned to multiple characters.

Paul Hardy’s Unifont project is one example of a bitmap-to-outline-converted TTF font that suffers from duplicated glyphs within the same font, and I don’t know if there is some undocumented, automated way to detect exact glyph duplicates within a font and merge / unify them into a single glyph mapped to multiple characters. I am also working on a separate bitmap-to-outline TTF font (based around the same Perl scripts as Unifont) that also suffers from this problem and would like to optimize my font by automatically merging any duplicate glyphs (I do not have the patience to manually check one-by-one all cases of glyph duplication in my font).

Any help here would be greatly appreciated. Thankees!

I’ve designed several commercial fonts using FontLab and Glyphs, but I’ve never had much experience with FontForge or writing either Perl or Python scripts to help facilitate their construction. You might not get many answers to your questions here — most graphic designers use fonts extensively, but building them is another matter.

The forum where you’ll likely find someone to answer your questions is

©2020 Graphic Design Forum | Contact | Legal | Twitter | Facebook