diff options
author | B. Watson <yalhcru@gmail.com> | 2017-04-03 03:30:23 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2017-04-03 03:30:23 -0400 |
commit | 229dc8d1b9372f89343b3742486496b06aeb813b (patch) | |
tree | fa1b881990fdcaacce218647732f77b667997dbb /ttf2psfu.sh | |
download | ttf-console-fonts-229dc8d1b9372f89343b3742486496b06aeb813b.tar.gz |
initial commit
Diffstat (limited to 'ttf2psfu.sh')
-rw-r--r-- | ttf2psfu.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ttf2psfu.sh b/ttf2psfu.sh new file mode 100644 index 0000000..ef5a55a --- /dev/null +++ b/ttf2psfu.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# uses otf2bdf and bdf2psf to turn a ttf/otf font into a console font. +# all args are passed through to otf2bdf, please don't pass -o file.bdf. + +# right now, output is to test.psfu. This will change in the future. + +otf2bdf "$@" -c C -o tmp.bdf + +# lie to bdf2psf, dirty hack alert! bdf2psf needs the AVERAGE_WIDTH +# to be a multiple of 10. And it messes up the kerning if we don't +# add a fudge factor (the 30, below). +AV=$( sed -n 's,AVERAGE_WIDTH ,,p' tmp.bdf ) +AV=$(( ( AV + 30 ) / 10 * 10 )) +sed -i "/AVERAGE_WIDTH/s, .*, $AV," tmp.bdf + +SETDIR=/usr/share/bdf2psf + +# bdf2psf wants all this crap passed as a single argument with no +# spaces. I need to be able to read and maybe modify the list, so: +SETS="\ +$SETDIR/ascii.set+\ +$SETDIR/linux.set+\ +$SETDIR/fontsets/Lat2.256+\ +$SETDIR/fontsets/Uni1.512+\ +$SETDIR/useful.set\ +" + +bdf2psf --fb tmp.bdf $SETDIR/standard.equivalents $SETS 512 test.psfu |