summaryrefslogtreecommitdiff
path: root/tools/font/makefont.sh
blob: 37235fad580664e9f9af01d834e8c769ecd7df83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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