importSVG.py 482 Bytes
Newer Older
antoine's avatar
antoine committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# /usr/bin/env python
# -*- coding: utf-8 -*-

import fontforge
import glob
import sys

NameFile = sys.argv[1]

font = fontforge.open('temp/font.sfd')
svg_final = glob.glob('svg/clean/*svg')

for letter_svg in svg_final:
    letter = letter_svg.split("/")[-1].replace(".svg", "")
    print(letter)
    glyph = font.createChar(int(letter))
    glyph.width = 611
    glyph.importOutlines(letter_svg)


font.fontname = 'Metahoguet-'+NameFile
font.familyname = 'Metahoguet'
antoine's avatar
antoine committed
23
font.save()