Created
June 26, 2022 17:18
-
-
Save jenskutilek/edebfe32006519ae1db6e528fca24b62 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
from defcon import Font | |
from os import utime | |
path = Path(__file__).parent | |
for ufo_path in path.rglob('*.ufo'): | |
vfb_path = ufo_path.with_suffix(".vfb") | |
print(vfb_path) | |
if vfb_path.exists: | |
f = Font(ufo_path) | |
if not (ufo_path / "layercontents.plist").exists: | |
print("Converting to UFO 3") | |
f.save(formatVersion=3) | |
try: | |
stat = vfb_path.stat() | |
utime(ufo_path, (stat.st_mtime, stat.st_mtime)) | |
except FileNotFoundError: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment