summaryrefslogtreecommitdiffstats
path: root/font/scripts/genfonts.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:44:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:44:05 +0000
commitd318611dd6f23fcfedd50e9b9e24620b102ba96a (patch)
tree8b9eef82ca40fdd5a8deeabf07572074c236095d /font/scripts/genfonts.sh
parentInitial commit. (diff)
downloadgroff-d318611dd6f23fcfedd50e9b9e24620b102ba96a.tar.xz
groff-d318611dd6f23fcfedd50e9b9e24620b102ba96a.zip
Adding upstream version 1.23.0.upstream/1.23.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'font/scripts/genfonts.sh')
-rwxr-xr-xfont/scripts/genfonts.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/font/scripts/genfonts.sh b/font/scripts/genfonts.sh
new file mode 100755
index 0000000..ad45612
--- /dev/null
+++ b/font/scripts/genfonts.sh
@@ -0,0 +1,23 @@
+#!/bin/sh -xv
+# Usage:
+# genfonts.sh <input .proto file> <RES> <CPI> <FONT name>
+if test -z "$1" || test -z "$2" || test -z "$3" || test -z "$4"; then
+ echo "genfonts.sh: missing parameter"; exit 255;
+fi
+
+INPUT=$1
+RES=$2
+CPI=$3
+FONT=$4
+charwidth=`expr $RES / $CPI` ;
+sed -e "s|^name [A-Z]*$|name $FONT|" \
+ -e \
+ "s/^\\([^ ]*\\) [0-9][0-9]* /\\1 $charwidth /" \
+ -e "s/^spacewidth [0-9][0-9]*$/spacewidth $charwidth/" \
+ -e "s|^internalname .*$|internalname $FONT|" \
+ -e "/^internalname/s/CR/4/" \
+ -e "/^internalname/s/BI/3/" \
+ -e "/^internalname/s/B/2/" \
+ -e "/^internalname/s/I/1/" \
+ -e "/^internalname .*[^ 0-9]/d" \
+ $INPUT