Skip to content

Commit

Permalink
fix: correctly generate spacers
Browse files Browse the repository at this point in the history
  • Loading branch information
mishamyrt committed Aug 2, 2024
1 parent 66704a6 commit 7f8806e
Show file tree
Hide file tree
Showing 3 changed files with 940 additions and 346 deletions.
2 changes: 1 addition & 1 deletion scripts/font.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def set_features(font: GlyphsFont, cls: list[str], fea: list[GSFeature]):
features = fea.copy()
calt = generate_calt(font)
features.append(calt)
generate_spacers(font.ligatures(), font.file.glyphs)
font.set_classes(cls)
font.set_features(features)

Expand All @@ -116,6 +115,7 @@ def load_font(args):
for file in config_file["family"]:
font = GlyphsFont(os.path.join(source_dir, file))
config["fonts"].append(font)
generate_spacers(font.ligatures(), font.file.glyphs)
if config_file["family"][file] == "all":
set_features(font, cls, fea)
return args, config
Expand Down
2 changes: 2 additions & 0 deletions scripts/liblilex/generator/spacers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def generate_spacers(ligatures: list[str], glyphs: list[GSGlyph]) -> list[str]:

unique = list(set(unique))
template = glyphs["spacer.tpl"]
if template is None:
raise ValueError("Missing 'spacer.tpl' in glyphs font")
for glh in unique:
name = f"{glh}.spacer"
if name not in glyphs:
Expand Down
Loading

0 comments on commit 7f8806e

Please sign in to comment.