Created
December 19, 2025 08:55
-
-
Save smellman/97054ebf61ed56300141bc87721194b2 to your computer and use it in GitHub Desktop.
Font to SVG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -euo pipefail | |
| if [ $# -ne 2 ]; then | |
| echo "Usage: $0 PATH_TO/FONT.OTF OUTPUT_DIRECTORY" >&2 | |
| exit 1 | |
| fi | |
| FONT="$1" | |
| OUTPUT_DIR="$2" | |
| echo "Converting font $FONT to SVGs in directory $OUTPUT_DIR" | |
| mkdir -p "$OUTPUT_DIR" | |
| fontforge -lang=ff -script /dev/stdin <<EOF | |
| Open("$FONT") | |
| SelectWorthOutputting() | |
| Export("$OUTPUT_DIR/%u-%n.svg") | |
| EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment