[cantarell-fonts] Instantiator: use source.font if not None, else load
- From: Nikolaus Waxweiler <nwaxweiler src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cantarell-fonts] Instantiator: use source.font if not None, else load
- Date: Mon, 1 Apr 2019 22:09:51 +0000 (UTC)
commit 464d7aa28d444163184f1909b14e3d9aa60b04f1
Author: Nikolaus Waxweiler <madigens gmail com>
Date: Mon Apr 1 23:09:30 2019 +0100
Instantiator: use source.font if not None, else load
scripts/instantiator.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/scripts/instantiator.py b/scripts/instantiator.py
index 8abdde6d..1fb75846 100644
--- a/scripts/instantiator.py
+++ b/scripts/instantiator.py
@@ -66,10 +66,13 @@ class Instantiator:
glyph_names: Set[str] = set()
for source in designspace.sources:
- if not Path(source.path).exists():
- raise ValueError(f"Source at path '{source.path}' not found.")
- source.font = ufoLib2.Font.open(source.path, lazy=False)
- glyph_names.update(source.font.keys())
+ if source.font is not None:
+ glyph_names.update(source.font.keys())
+ else:
+ if not Path(source.path).exists():
+ raise ValueError(f"Source at path '{source.path}' not found.")
+ source.font = ufoLib2.Font.open(source.path, lazy=False)
+ glyph_names.update(source.font.keys())
# Construct Variators
axis_bounds: Dict[str, Tuple[float, float, float]] = {}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]