From 4cd138955db17dcf01a605153806f48dc28529a8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 12 Sep 2002 13:49:57 +0000 Subject: Greg's font scripts git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2272 a1c6a512-1295-4272-9138-f99709370657 --- tools/bdf2fnt | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 tools/bdf2fnt (limited to 'tools/bdf2fnt') diff --git a/tools/bdf2fnt b/tools/bdf2fnt new file mode 100755 index 0000000000..97b8292ba4 --- /dev/null +++ b/tools/bdf2fnt @@ -0,0 +1,39 @@ +#!/bin/bash +# +# bdf2fnt - shell script to convert a BDF file to RBF format +# +# usage: bdf2fnt bdffile (don't use .bdf extension!) +# +# Example: bdf2fnt courB08 +# creates ./courB08.fnt and /tmp/courB08.c +# the .fnt file can be renamed /system.fnt for loading +# the .c file can be moved to firmware dir to compile-in font +# + +# convert from bdf to C source +./bdf2c $1.bdf > /tmp/$1.c + +# compile writerbf with linked C source font +gcc -DFONT=font_$1 -I../firmware -o /tmp/writerbf writerbf.c /tmp/$1.c + +# run writerbf, will write linked incore font to .rbf format +/tmp/writerbf +rm /tmp/writerbf + +# load .rbf font and display it for test +gcc -DMAX_FONT_SIZE=500000 -o /tmp/loadrbf loadrbf.c +/tmp/loadrbf $1.fnt > /tmp/$1.1 +rm /tmp/loadrbf + +# link .c font and diff with .fnt load for test +gcc -DFONT=font_$1 -I../firmware -o /tmp/loadrbf loadrbf.c /tmp/$1.c +/tmp/loadrbf > /tmp/$1.2 +rm /tmp/loadrbf + +# +# we diff the output to ensure correctness +diff /tmp/$1.1 /tmp/$1.2 + +# clean up +rm /tmp/$1.1 /tmp/$1.2 +#rm /tmp/$1.c -- cgit v1.2.3