2015-05-23 13:35:12 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
N=0
|
|
|
|
HEIGHT=16
|
|
|
|
FONTFILE="8x16std"
|
|
|
|
|
|
|
|
(
|
2017-09-09 22:03:17 +02:00
|
|
|
echo -e "// vgafont.h\\n"
|
2017-04-09 20:08:53 +02:00
|
|
|
echo -e "#ifndef FVGAFONT_H"
|
2017-09-09 22:03:17 +02:00
|
|
|
echo -e "#define FVGAFONT_H\\n"
|
2015-05-23 13:35:12 +02:00
|
|
|
|
|
|
|
xxd -g 1 -i -c $HEIGHT $FONTFILE \
|
|
|
|
| sed -e 's/ {$/\n{/' \
|
|
|
|
| sed -e 's/^unsigned/static unsigned/' \
|
|
|
|
| sed -e '/len = /d' \
|
2016-04-02 18:35:34 +02:00
|
|
|
| while IFS=$'\n'; read -r LINE
|
2015-05-23 13:35:12 +02:00
|
|
|
do
|
|
|
|
if [ "${LINE:0:1}" != " " ]
|
|
|
|
then
|
|
|
|
echo "$LINE"
|
|
|
|
else
|
|
|
|
echo "$LINE /* $N */" | sed -e 's/\([0-9]\) \/\*/\1 \/*/'
|
|
|
|
let N++
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2017-09-09 22:03:17 +02:00
|
|
|
echo -e "\\n#endif // FVGAFONT_H"
|
2015-05-23 13:35:12 +02:00
|
|
|
) > vgafont.h
|