char/iocgn-mono

iosevka variant inspired by Simple Köln-Bonn

git clone https://git.t4t.associates/char/iocgn-mono

Charlotte Somadd oblique variants174e7ae

main
654 B23 linesraw
1"""Compress the finished static and variable TTFs for the web."""
2
3from pathlib import Path
4
5from fontTools.ttLib import TTFont
6
7ROOT = Path(__file__).resolve().parent.parent
8
9
10def main():
11    source = ROOT / 'build/TTF'
12    output = ROOT / 'build/WOFF2'
13    output.mkdir(parents=True, exist_ok=True)
14    for path in sorted(source.glob('*.ttf')):
15        destination = output / path.with_suffix('.woff2').name
16        with TTFont(path, recalcTimestamp=False) as font:
17            font.flavor = 'woff2'
18            font.save(destination)
19        print(f'Compressed {path.name} → {destination.relative_to(ROOT)}')
20
21
22if __name__ == '__main__':
23    main()