From de5c3a983ff4be6fcd1352c21a20d651d95b5ff0 Mon Sep 17 00:00:00 2001 From: kaush <1042037+kaushikgopal@users.noreply.github.com> Date: Fri, 12 Nov 2021 16:27:02 -0800 Subject: [PATCH] glob a default fontPath if not provided --- scripts/instantiate-code-fonts.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/instantiate-code-fonts.py b/scripts/instantiate-code-fonts.py index a218bb4..b2d546a 100644 --- a/scripts/instantiate-code-fonts.py +++ b/scripts/instantiate-code-fonts.py @@ -9,6 +9,7 @@ import os import pathlib +import glob from fontTools import ttLib from fontTools.varLib import instancer from opentype_feature_freezer import cli as pyftfeatfreeze @@ -30,7 +31,10 @@ configPath = './config.yaml' # gets font path passed in -fontPath = sys.argv[2] +try: + fontPath = sys.argv[2] +except IndexError: + fontPath = glob.glob('./font-data/Recursive_VF_*.ttf')[0] # read yaml config with open(configPath) as file: @@ -191,7 +195,7 @@ def splitFont( fs_selection &= 1 << 7 if instance == "Italic": - + monoFont["head"].macStyle = 0b10 # In the OS/2 table Panose bProportion must be set to 11 for "oblique boxed" (this is partially a guess) monoFont["OS/2"].panose.bLetterForm = 11