Imported Upstream version 1.22.4
[platform/upstream/groff.git] / font / scripts / gendesc.sh
1 #!/bin/sh
2 # Usage: gendesc.sh <input .proto> <RES> <CPI> <LPI> <list of fonts>
3 if test -z "$1" || test -z "$2" || test -z "$3" || test -z "$4" || \
4     test -z "$5"; then
5     echo "genfonts.sh: missing parameter"; exit 255;
6 fi
7 INPUT=$1
8 RES=$2
9 CPI=$3
10 LPI=$4
11 shift 4
12 NBFONTS=`echo $#`
13 FONTS=`echo $*`
14 sed -e "s/^res .*$/res $RES/" \
15     -e "s/^hor .*$/hor `expr $RES / $CPI`/" \
16     -e "s/^vert .*$/vert `expr $RES / $LPI`/" \
17     -e "s/^fonts .*$/fonts $NBFONTS $FONTS/" \
18     $INPUT