summaryrefslogtreecommitdiff
path: root/tools/bdf2fnt
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-09-12 13:49:57 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-09-12 13:49:57 +0000
commit4cd138955db17dcf01a605153806f48dc28529a8 (patch)
treec694903e605b7d9920712dd4d6de14a1e7caa881 /tools/bdf2fnt
parent05e353acfc6c84c7105972fd8cf21e9fef5e9a62 (diff)
downloadrockbox-4cd138955db17dcf01a605153806f48dc28529a8.tar.gz
rockbox-4cd138955db17dcf01a605153806f48dc28529a8.zip
Greg's font scripts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2272 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/bdf2fnt')
-rwxr-xr-xtools/bdf2fnt39
1 files changed, 39 insertions, 0 deletions
diff --git a/tools/bdf2fnt b/tools/bdf2fnt
new file mode 100755
index 0000000000..97b8292ba4
--- /dev/null
+++ b/tools/bdf2fnt
@@ -0,0 +1,39 @@
1#!/bin/bash
2#
3# bdf2fnt - shell script to convert a BDF file to RBF format
4#
5# usage: bdf2fnt bdffile (don't use .bdf extension!)
6#
7# Example: bdf2fnt courB08
8# creates ./courB08.fnt and /tmp/courB08.c
9# the .fnt file can be renamed /system.fnt for loading
10# the .c file can be moved to firmware dir to compile-in font
11#
12
13# convert from bdf to C source
14./bdf2c $1.bdf > /tmp/$1.c
15
16# compile writerbf with linked C source font
17gcc -DFONT=font_$1 -I../firmware -o /tmp/writerbf writerbf.c /tmp/$1.c
18
19# run writerbf, will write linked incore font to .rbf format
20/tmp/writerbf
21rm /tmp/writerbf
22
23# load .rbf font and display it for test
24gcc -DMAX_FONT_SIZE=500000 -o /tmp/loadrbf loadrbf.c
25/tmp/loadrbf $1.fnt > /tmp/$1.1
26rm /tmp/loadrbf
27
28# link .c font and diff with .fnt load for test
29gcc -DFONT=font_$1 -I../firmware -o /tmp/loadrbf loadrbf.c /tmp/$1.c
30/tmp/loadrbf > /tmp/$1.2
31rm /tmp/loadrbf
32
33#
34# we diff the output to ensure correctness
35diff /tmp/$1.1 /tmp/$1.2
36
37# clean up
38rm /tmp/$1.1 /tmp/$1.2
39#rm /tmp/$1.c