This commit is contained in:
Reudy 2026-09-26 19:13:02 +02:00
commit 0ad405c26e
78 changed files with 9127 additions and 0 deletions

13
scripts/subset-fonts.sh Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Subsets the bundled fonts to Latin (+Extended), Greek, Cyrillic, punctuation,
# arrows and common math. pdf-lib's own subsetter drops glyphs, so the PDF
# writer embeds these pre-subset files whole.
set -euo pipefail
cd "$(dirname "$0")/.."
UNICODES="U+0000-024F,U+0300-036F,U+0370-03FF,U+0400-04FF,U+1E00-1EFF,U+2000-206F,U+20A0-20CF,U+2100-214F,U+2190-21FF,U+2200-22FF,U+2460-24FF,U+25A0-25FF,U+2713,U+2717"
for f in static/fonts/*.ttf; do
pyftsubset "$f" --unicodes="$UNICODES" --layout-features='kern,liga,calt,ccmp,locl,mark,mkmk' \
--no-hinting --desubroutinize --output-file="$f.sub"
mv "$f.sub" "$f"
done
ls -la static/fonts