1 #!/bin/sh 2 3 #### 4 #### Test the output of Ted --FontsDocuments 5 #### For all documents, we check whether the correct font has 6 #### been selected, and whether it can be converted to PDF 7 #### 8 9 TMP=/tmp/$$.txt 10 trap "rm -f $TMP" 0 11 12 for rtf in *.rtf 13 do 14 base=`basename $rtf .rtf` 15 ps=$base.ps 16 pdf=$base.pdf 17 18 rtf2ps.sh $rtf $ps 19 20 sed -n \ 21 -e '/^%%BeginProlog:/{q}' \ 22 -e '/^%%DocumentSuppliedFonts:/{q}' \ 23 -e 's/^%%DocumentFonts: *//p' \ 24 -e 's/^%%+ *//p' \ 25 $ps > $TMP 26 read used < $TMP 27 28 if grep -q -x "$base" $TMP 29 then 30 echo $rtf: Uses font $base 31 else 32 echo $rtf: '##' Does not use $base. Fonts: `cat $TMP` 33 fi 34 35 # gs produces error output on stdout 36 if ps2pdf $ps $pdf 1>&2 37 then 38 : ok 39 else 40 echo $rtf: '##' Cound not convert $ps to $pdf 41 rm -f $pdf 42 fi 43 done