diff --git a/STAT.yaml b/STAT.yaml index c83b68e0..e210f4ba 100644 --- a/STAT.yaml +++ b/STAT.yaml @@ -1,4 +1,4 @@ -"Lilex-VF.ttf": +"Lilex.ttf": - tag: wght name: Weight values: diff --git a/requirements.txt b/requirements.txt index 35c06442..56111560 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,4 @@ pylance==0.8.17 fontbakery[freetype]==0.12.5 dehinter==4.0.0 shaperglot==0.5.0 +uharfbuzz==0.39.1 diff --git a/scripts/builder/make.py b/scripts/builder/make.py index f4cffa32..ca5bff44 100644 --- a/scripts/builder/make.py +++ b/scripts/builder/make.py @@ -1,6 +1,6 @@ """Make helpers""" import subprocess as sp -from os import unlink +from os import listdir, unlink from shutil import move, which STAT_CONFIG = 'STAT.yaml' @@ -31,20 +31,23 @@ def _fix_variable(font_dir, family_name) -> bool: "gen-stat", "--inplace", f'--src "{STAT_CONFIG}"', - f'"{font_dir}/{family_name}-VF.ttf"') + f'"{font_dir}/{family_name}.ttf"') def _fix_ttf(font_dir, family_name) -> bool: """Fix bold fsSelection and macStyle""" - bold_path = f'{font_dir}/{family_name}-Bold.ttf' - success = _gftools( - "fix-font", - "--include-source-fixes", - bold_path - ) - if not success: - return False - unlink(bold_path) - move(f'{bold_path}.fix', bold_path) + files = listdir(font_dir) + print(files) + for file in files: + file_path = f'{font_dir}/{file}' + success = _gftools( + "fix-font", + "--include-source-fixes", + file_path + ) + if not success: + return False + unlink(file_path) + move(f'{file_path}.fix', file_path) return True POST_FIXES = { @@ -52,19 +55,21 @@ def _fix_ttf(font_dir, family_name) -> bool: "variable": _fix_variable } -def make(family_name: str, ds_path: str, fmt: str, out_dir: str, ) -> bool: +def make(family_name: str, ds_path: str, fmt: str, out_dir: str) -> bool: """Wrapper for fontmake""" cmd = [ _which("fontmake"), f'-m "{ds_path}"', f'-o "{fmt}"', - f'--output-dir "{out_dir}"', "--flatten-components", "--autohint", "--filter DecomposeTransformedComponentsFilter" ] - if fmt != "variable": + if fmt == "variable": + cmd.append(f'--output-path "{out_dir}/{family_name}.ttf"') + else: cmd.append("--interpolate") + cmd.append(f'--output-dir "{out_dir}"') success = _run(*cmd) if not success: return False