boot-maker: Fix warnings (missing header file)
[h316.git] / pc-tools / fontgen / data / gen.sh
CommitLineData
b17cb324 1#!/bin/bash
2
3IFS="
4"
5cat <<EOF
6#include <stdio.h>
7#include "fontgen.h"
8
9EOF
10
11glyphs=
12no_glyphs=0
13cont=1
14
15while [ $cont == 1 ] ; do
16 if ! line=`line`; then cont=0; fi
17 number=$((`echo $line | cut -b 1-5`))
18 echo proc: $number 1>&2
19 size=$((`echo $line | cut -b 6-8`))
20# echo "-$number-$size-"
21 plabel="points_$number"
22 echo "static pl_point $plabel[]={"
23 i=0
24 while [ $i -lt $size ]; do
25 c1=`echo $line | cut -b $((9+$i*2))| sed 's/\\\\/\\\\\\\\/g'`
26 c2=`echo $line | cut -b $((10+$i*2))| sed 's/\\\\/\\\\\\\\/g'`
27
28 echo -n " {.p_data=(((int)'$c1')<<8)+('$c2')}"
29 if [ $i -lt $(($size-1)) ]; then
30 echo ","
31 fi
32 i=$(($i+1))
33 done
34 echo -e "\n };"
35
36 glyphs+=`echo -e "\n{.gl_size=$size,.gl_points=$plabel,.gl_number=$number}"`
37 no_glyphs=$(($no_glyphs+1))
38done
39
40echo -e "\n\npl_glyph hershey_glyphs[]={"
41g=0
42for n in $glyphs; do
43 g=$(($g+1))
44 echo -n " $n"
45 if [ $g -eq $(($no_glyphs)) ]; then
46 echo
47 else
48 echo ","
49 fi
50done
51echo " };"
52echo -e "\n\n"
53
54echo "pl_font hershey_fonts={"
55echo " .f_label=\"HERSHY\","
56echo " .f_size=$no_glyphs,"
57echo " .f_glyphs=hershey_glyphs"
58echo " };"
59
60
61echo -e "\n/* End. */"