| 1 |
import os |
| 2 |
from os import path |
| 3 |
import fontforge |
| 4 |
import shutil |
| 5 |
|
| 6 |
for file in os.listdir(): |
| 7 |
if file.endswith(".sfd"): |
| 8 |
font = fontforge.open(file) |
| 9 |
font.generate(os.path.splitext(file)[0]+".ttf") |
| 10 |
|
| •11 |
if not path.exists(os.getcwd() + "/master_ttf"): |
| 12 |
os.mkdir(os.getcwd() + "/master_ttf") |
| 13 |
|
| 14 |
sourcepath = os.getcwd() |
| 15 |
sourcefiles = os.listdir(sourcepath) |
| •16 |
destinationpath = os.getcwd() + "/master_ttf" |
| 17 |
for file in sourcefiles: |
| 18 |
if file.endswith('.ttf'): |
| 19 |
shutil.move(os.path.join(sourcepath,file), os.path.join(destinationpath,file)) |
| 20 |
|
| 21 |
|
| 22 |
|