summaryrefslogtreecommitdiff
path: root/tools/font/makefont.sh
diff options
context:
space:
mode:
authormagh <magh@maghmogh.com>2023-03-06 18:44:55 -0600
committermagh <magh@maghmogh.com>2023-03-06 18:44:55 -0600
commite80d9d8871b325a04b18f90a9ea4bb7fd148fb25 (patch)
tree79dbdb8506b7ff1e92549188d1b94cfc0b3503ae /tools/font/makefont.sh
add m1n1HEADmaster
Diffstat (limited to 'tools/font/makefont.sh')
-rwxr-xr-xtools/font/makefont.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/font/makefont.sh b/tools/font/makefont.sh
new file mode 100755
index 0000000..37235fa
--- /dev/null
+++ b/tools/font/makefont.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+width=$1
+height=$2
+size=$3
+fontfile=$4
+outfile=$5
+shift 5
+
+(
+for ord in $(seq 32 126); do
+ printf "\\x$(printf %x $ord)\\n"
+done
+) | convert \
+ -page ${width}x$((height*95)) \
+ -background black \
+ -fill white \
+ -antialias \
+ -font $fontfile \
+ -density 72 \
+ -gravity north \
+ -pointsize $size \
+ $* \
+ -define quantum:format=unsigned \
+ -depth 8 \
+ label:\@- \
+ -crop ${width}x$((height*95)) \
+ gray:$outfile