Posts

Showing posts with the label Python

Batch import SVG glyphs to FontForge and create TTF

Image
Here is a Python script to batch Import SVG glyph files into FontForge and create TTF font automatically. Get FontForge first and install it. Save this script as  import_svg.py in the same folder there you have SVG-files. On Windows: run C:\Program Files (x86)\FontForgeBuilds\fontforge-console.bat navigate to the folder with your SVG-files using 'cd <FOLDER_PATH>' Run Python script by using " ffpython import_svg.py " # Batch Import SVG glyph files into FontForge and create TTF # Get FontForge first and install it.. # On Windows: # run C:\Program Files (x86)\FontForgeBuilds\fontforge-console.bat # navigate to the folder using 'cd <FOLDER_PATH>' # Run Python script by using "ffpython import_svg.py" import fontforge , os , pathlib str1 = os . getcwd () str2 = str1 . split ( '\\' ) n = len ( str2 ) fontname = ( str2 [ n - 1 ]) uzer = os . getlogin () font = fontforge . font () # new font font . encoding ...