Commit bfbdc646 authored by Sebastian Friedl's avatar Sebastian Friedl
Browse files

Merge branch 'staging' into 'release'

GYPT Fonts 0.2.1

See merge request !3
parents 905c53c0 89def38f
0.2.1 (2021-10-02)
------------------
- Provide default values for Sass variables
0.2.0 (2021-09-20)
------------------
- Fix subfamily names for weight 500
......
......@@ -3,7 +3,6 @@
from multiprocessing import Pool
import os
from pathlib import Path
import sys
from time import time
from fontTools.ttLib import TTFont
......@@ -183,7 +182,7 @@ def generate_stylesheet(style):
f"}}",
])
chunks = {'css': [], 'scss': []}
chunks = {'css': [], 'scss': [f'$gypt{style.lower()}-font-path: "." !default;']}
for weight, options in INSTANCES.items():
_, verbose_weight = options
......@@ -203,15 +202,15 @@ def generate_stylesheet(style):
def main():
exit_code = 0
pool_terminated = False
def term(pool):
def handler(e):
print(e)
pool.terminate()
nonlocal exit_code
exit_code = 1
nonlocal pool_terminated
pool_terminated = True
return handler
......@@ -221,14 +220,14 @@ def main():
p.apply_async(slice_font, (style, source, weight, *options), {'italic': False}, error_callback=term(p))
p.apply_async(slice_font, (style, source, weight, *options), {'italic': True}, error_callback=term(p))
generate_stylesheet(style)
p.apply_async(generate_stylesheet, (style,), error_callback=term(p))
p.close()
p.join()
if exit_code:
# pool has been terminated, exit with error code
sys.exit(exit_code)
if pool_terminated:
# pool has been terminated, raise an exception
raise Exception
if __name__ == '__main__':
......
brotli==1.0.9
fonttools==4.26.2
fonttools==4.27.1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment