ui: Trim FontAwesome font to glyphs in use (save 940KiB)

This commit is contained in:
Matt Borgerson
2025-03-06 03:00:45 -07:00
committed by mborgerson
parent fdb78c5dbd
commit 046d127f31
4 changed files with 11 additions and 4 deletions
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
set -ex
# uv tool install fonttools
FONT_INPUT=font_awesome_6_1_1_solid.otf
FONT_OUTPUT=font_awesome_6_1_1_solid.min.otf
GLYPHS=$(grep -rhoE "ICON_FA_\w+" ../ui/xui | sort | uniq | sed -E 's/^ICON_FA_//; s/_/-/g; s/.*/\L&/' | paste -sd ",")
pyftsubset $FONT_INPUT --output-file=$FONT_OUTPUT --glyphs=$GLYPHS