Skip to content

Commit

Permalink
Pretty print features
Browse files Browse the repository at this point in the history
  • Loading branch information
mishamyrt committed Mar 31, 2023
1 parent 7cfd4f9 commit 9b29d4e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scripts/lilex.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from builder import SUPPORTED_FORMATS, GlyphsFont
from generator import generate_spacers, render_ligatures
from glyphsLib import GSFeature, GSFont
from utils import read_classes, read_features, read_files
from utils import print_warn, read_classes, read_features, read_files

FONT_FILE = "Lilex.glyphs"
CLASSES_DIR = "./classes"
Expand Down Expand Up @@ -74,6 +74,7 @@ def create_font(args):
if args.features is not None:
features = args.features.split(",")
move_to_calt(font.file, features)
print_warn(f"Forced features: {', '.join(features)}")
return args, font

if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Lilex utilities module"""
from .cli import print_gs
from .cli import print_gs, print_warn
from .files import read_classes, read_features, read_files
5 changes: 5 additions & 0 deletions scripts/utils/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@

from glyphsLib import GSFeature

ORANGE = "\033[93m"
RESET = "\033[0m"

def print_gs(title: str, items: List[GSFeature]):
print(f"{title}:")
for item in items:
print(f" - {item.name}")

def print_warn(message: str):
print(f"{ORANGE}{message}{RESET}")

0 comments on commit 9b29d4e

Please sign in to comment.