5 rm -f rules/*.rules rules/foundries.new
11 ord=`perl -e 'print ord($ARGV[0]),"\n" or die $!' "$c"`
15 c=`perl -e 'printf "%c", $ARGV[0]' "$ord"`
22 ./printrule >&3 "$bad" "$good" $height \
23 "^ENCODING $ord$" $partial "$c"
30 while read keyword rest; do
39 zcat $in | pcf2bdf >$out
40 elif [ -e "$out.direct" ]; then
41 cp "$out.direct" "$out"
42 elif [ -e "$f/$pcf.sfd" ]; then
43 ./ffconvert.pe "$f/$pcf"
44 # 1. fontforge writes a silly filename
45 # 2. our crappy machinery copes only
46 # with BDFs all of whose chars have
47 # the bbox of the font
48 ./bdfnorm <"$f/$pcf".BDF*.bdf >$out
50 echo >&2 "cannot make $out!"
59 next unless s/^BBX\s+//;
62 s/[-+]?\b\d+\b/ sprintf "%d", $& /ge;
63 m/^\d+\,(\d+)\b/ or die;
64 print "key=$_; height=$1\n" or die $!;
67 oldfoundry=`perl -ne '
68 next unless s/^FOUNDRY\s+\"?//;
73 case "$seenfoundries" in
74 */"$oldfoundry,$newfoundry"/*)
77 echo >&2 "inconsistent foundry mapping"
81 seenfoundries=$seenfoundries$oldfoundry,$newfoundry/
82 printf >>rules/foundries.new \
83 "%s %s\n" "$oldfoundry" "$newfoundry"
87 */"$newfoundry,$key"/*)
88 exec 3>>rules/$newfoundry,$key.rules
91 exec 3>rules/$newfoundry,$key.rules
92 echo >&3 '# -*- perl -*-'
93 echo >&3 '# autogenerated by mkrules'
95 seenrules=$seenrules$newfoundry,$key/
115 echo >&2 "??? $keyword"
122 case "$seenrules" in /) break ;; esac
123 seenrules=${seenrules#/}
124 rulefile=${seenrules%%/*}
125 seenrules=/${seenrules#*/}
126 echo "}" >>rules/$rulefile.rules
129 mv rules/foundries.new rules/foundries