Skip to content

Commit

Permalink
Derive output directory defaults from outputDir, fixes #846
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed Mar 8, 2024
1 parent 8b97982 commit ed030d9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Lib/gftools/builder/recipeproviders/googlefonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
# Taken from gftools-builder
DEFAULTS = {
"outputDir": "../fonts",
"vfDir": "../fonts/variable",
"ttDir": "../fonts/ttf",
"otDir": "../fonts/otf",
"woffDir": "../fonts/webfonts",
"vfDir": "$outputDir/variable",
"ttDir": "$outputDir/ttf",
"otDir": "$outputDir/otf",
"woffDir": "$outputDir/webfonts",
"buildStatic": True,
"buildOTF": True,
"buildTTF": True,
Expand Down Expand Up @@ -58,6 +58,8 @@ def write_recipe(self):
self.config.revalidate(GOOGLEFONTS_SCHEMA)

self.config = {**DEFAULTS, **self.config}
for field in ["vfDir", "ttDir", "otDir", "woffDir"]:
self.config[field] = self.config[field].replace("$outputDir", self.config["outputDir"])
self.config["buildWebfont"] = self.config.get(
"buildWebfont", self.config.get("buildStatic", True)
)
Expand Down

0 comments on commit ed030d9

Please sign in to comment.