From ab74f660dd0301995d2b71be27e89764e1ee4b5e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 25 May 2023 20:52:06 +0200 Subject: Remove stale stuff. --- tools/fonts/woff2css2 | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100755 tools/fonts/woff2css2 (limited to 'tools/fonts') diff --git a/tools/fonts/woff2css2 b/tools/fonts/woff2css2 deleted file mode 100755 index 8105524..0000000 --- a/tools/fonts/woff2css2 +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/python3 - -# Embed a woff2 font in a static CSS file. -# Usage: woff2css in.woff2 out.css -# -# Limitations: takes weight and style information from the file name of the font. -# This script will throw an unhelpful exception if weight and style cannot -# be determined. - -# @font-face { -# font-family: "Dinish"; -# font-weight: 700; -# font-style: bold; -# src: url(data:font/woff2;base64,d09GMgABAAAAACzcAA0AAAAAc/wAACyGAAIAxQAAAAAAAAAAAAAAAAAAAAAAAAAAGnYbnkIcg0IGYACDHAqBpT -# } - -import os -import re -import sys - -if not re.search(r"\.woff2$", sys.argv[1]): - print("Usage: woff2css *.woff2") - sys.exit(1) - -for src in sys.argv[1:]: - m = re.match(r"([\w-]+)-(\w+)\.", os.path.basename(src)) - if m: - family = m.group(1) - style = m.group(2) - else: - print("Font should be named Family-Style.woff2; could not determine font weight.") - sys.exit(1) - - s = ("@font-face{") - s += (f"font-family:'{family}';") - if style == "Bold" or style == "BoldItalic": - s += (f"font-weight:bold;") - if style == "Italic" or style == "BoldItalic": - s += (f"font-style:italic;") - s += (f"src:url('{src}')format('woff2')") - s += ("}") - print(s) -- cgit v1.2.3