1

I'm trying to generate a ttf font file from a bunch of SVGs or PNGs. Every time I try, I get the error:

"Warning: Font contained no glyphs"

I've tried this on Mac and Linux:

font = fontforge.font()
glyph = font.createChar(65, "font1")
glyph.importOutlines("1.png")
glyph2 = font.createChar(66, "font2")
glyph2.importOutlines("2.png")
glyph3 = font.createChar(67, "font3")
glyph3.importOutlines("3.png")
font.generate("output.ttf")

I tried the hints on: Import a sequence of .svg files into FontForge as glyphs and output a font file

but still couldn't get it to work.

If anyone has any ideas on a better library I can call from commmandline to convert SVG to TTF, that would be great.

Zeus
  • 569
  • 1
  • 7
  • 13
  • An update on this... it works with .svg files but not with .png. Any idea? – Zeus Nov 12 '18 at 21:12
  • because ttf font use vector graphics. you need to vecotrize your png's https://en.wikipedia.org/wiki/TrueType how to make a vector from png http://goinkscape.com/how-to-vectorize-in-inkscape/ – Nivatius Dec 04 '18 at 13:40

0 Answers0