shithub: neatmkfn

Download patch

ref: e1f6ca9d954bfd68207e929f1f9832d2383e219e
parent: dc32d76c4b60e5cb9f9d33920d1121bb93854d5e
author: Ali Gholami Rudi <ali@rudi.ir>
date: Fri Apr 20 13:37:37 EDT 2018

gen.sh: exit with an error if standard fonts are missing

Suggested by David Frey <david.frey@swissonline.ch>.

--- a/gen.sh
+++ b/gen.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Generate a neatroff output device
+# Generate a Neatroff output device
 
 FP="/path/to/gs/fonts"		# ghostscript fonts directory; should be in GS_FONTPATH
 TP="/path/to/font/devutf"	# output device directory
@@ -50,12 +50,11 @@
 # stdfont troff_name gs_font urw_font extra_mktrfn_options
 stdfont()
 {
-	if test -f $2
-	then
-		afmconv $1 "$2" $4 $5 $6 $7 $8 $9
-	else
-		afmconv $1 "$3" $4 $5 $6 $7 $8 $9
-	fi
+	FN="$2"
+	test -f "$FN" || FN="$3"
+	test -f "$FN" || echo "$0: Font <$2> not found!" >&2
+	test -f "$FN" || exit 1
+	afmconv $1 "$FN" $4 $5 $6 $7 $8 $9
 }
 
 # The standard fonts; ghostscriptfonts or urw-core35