|
Packit Service |
50ad14 |
#!/bin/bash
|
|
Packit Service |
50ad14 |
#written by Martin Lohner, SuSE GmbH, Dec 1998
|
|
Packit Service |
50ad14 |
echo "This script converts 256 character font to psf-fonts"
|
|
Packit Service |
50ad14 |
echo "It simply assumes that all files in the current directory"
|
|
Packit Service |
50ad14 |
echo "that have a size of (256*n) are fontfiles of 8xn pixel"
|
|
Packit Service |
50ad14 |
echo "fonts. If there are 512 character, non-psf-fonts you will"
|
|
Packit Service |
50ad14 |
echo "recognise this soon... Anyway, the setfont program isn´t"
|
|
Packit Service |
50ad14 |
echo "aware of this type of fonts, too. So there shouln´d be to"
|
|
Packit Service |
50ad14 |
echo "much of theese around."
|
|
Packit Service |
50ad14 |
echo "This script cares for font highs of 6,8,10,12,14,16 and 19"
|
|
Packit Service |
50ad14 |
echo "pixels"
|
|
Packit Service |
50ad14 |
echo ""
|
|
Packit Service |
50ad14 |
echo -n "Start converting now? (Old file will not be touched) (Y/N)"
|
|
Packit Service |
50ad14 |
read a
|
|
Packit Service |
50ad14 |
random=hfdsvnpoh97k
|
|
Packit Service |
50ad14 |
if [ $a = y -o $a = Y ] ; then
|
|
Packit Service |
50ad14 |
echo "Creating psf-headers..."
|
|
Packit Service |
50ad14 |
echo -ne "\066" > $random
|
|
Packit Service |
50ad14 |
echo -ne "\004" >> $random
|
|
Packit Service |
50ad14 |
echo -ne "\000" >> $random
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
echo -ne "\006" > $random.6.tmp
|
|
Packit Service |
50ad14 |
cat $random $random.6.tmp > $random.6
|
|
Packit Service |
50ad14 |
echo -ne "\010" > $random.8.tmp
|
|
Packit Service |
50ad14 |
cat $random $random.8.tmp > $random.8
|
|
Packit Service |
50ad14 |
echo -ne "\012" > $random.10.tmp
|
|
Packit Service |
50ad14 |
cat $random $random.10.tmp > $random.10
|
|
Packit Service |
50ad14 |
echo -ne "\014" > $random.12.tmp
|
|
Packit Service |
50ad14 |
cat $random $random.12.tmp > $random.12
|
|
Packit Service |
50ad14 |
echo -ne "\016" > $random.14.tmp
|
|
Packit Service |
50ad14 |
cat $random $random.14.tmp > $random.14
|
|
Packit Service |
50ad14 |
echo -ne "\020" > $random.16.tmp
|
|
Packit Service |
50ad14 |
cat $random $random.16.tmp > $random.16
|
|
Packit Service |
50ad14 |
echo -ne "\023" > $random.19.tmp
|
|
Packit Service |
50ad14 |
cat $random $random.19.tmp > $random.19
|
|
Packit Service |
50ad14 |
|
|
Packit Service |
50ad14 |
for i in 6 8 10 12 14 16 19; do
|
|
Packit Service |
50ad14 |
echo "Looking for 8x"$i"-fonts..."
|
|
Packit Service |
50ad14 |
for j in `find . -maxdepth 1 -type f -size $((i*=256))c`;
|
|
Packit Service |
50ad14 |
do
|
|
Packit Service |
50ad14 |
cat $random.$i $j > $j.psf
|
|
Packit Service |
50ad14 |
done
|
|
Packit Service |
50ad14 |
done
|
|
Packit Service |
50ad14 |
rm $random.*
|
|
Packit Service |
50ad14 |
else
|
|
Packit Service |
50ad14 |
exit 1
|
|
Packit Service |
50ad14 |
fi
|