diff options
Diffstat (limited to 'tools/bdf2fnt')
-rwxr-xr-x | tools/bdf2fnt | 39 |
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 | ||
17 | gcc -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 | ||
21 | rm /tmp/writerbf | ||
22 | |||
23 | # load .rbf font and display it for test | ||
24 | gcc -DMAX_FONT_SIZE=500000 -o /tmp/loadrbf loadrbf.c | ||
25 | /tmp/loadrbf $1.fnt > /tmp/$1.1 | ||
26 | rm /tmp/loadrbf | ||
27 | |||
28 | # link .c font and diff with .fnt load for test | ||
29 | gcc -DFONT=font_$1 -I../firmware -o /tmp/loadrbf loadrbf.c /tmp/$1.c | ||
30 | /tmp/loadrbf > /tmp/$1.2 | ||
31 | rm /tmp/loadrbf | ||
32 | |||
33 | # | ||
34 | # we diff the output to ensure correctness | ||
35 | diff /tmp/$1.1 /tmp/$1.2 | ||
36 | |||
37 | # clean up | ||
38 | rm /tmp/$1.1 /tmp/$1.2 | ||
39 | #rm /tmp/$1.c | ||