chiark / gitweb /
mkrules keys the rules key off `bad' rather than `good' (since some fonts have differ...
[xfonts-traditional.git] / mkrules
diff --git a/mkrules b/mkrules
index b55b3976f65bf4b2ce88839c8edcda284cee920e..5baa1d6dd97f27c32e959e02b4ef8ab463c32a9d 100755 (executable)
--- a/mkrules
+++ b/mkrules
@@ -25,6 +25,7 @@ chars () {
 }
 
 seenrules=/
+seenfoundries=/
 
 while read keyword rest; do
        case "$keyword" in
@@ -47,14 +48,26 @@ while read keyword rest; do
                        m/^\d+\,(\d+)\b/ or die;
                        print "key=$_; height=$1\n" or die $!;
                        exit;
-               ' <$good`
+               ' <$bad`
                oldfoundry=`perl -ne '
                        next unless s/^FOUNDRY\s+\"?//;
                        s/\"?\s+$//;
                        print or die $!;
                        exit;
                ' <$good`
-               printf "%s %s" "$oldfoundry" "$newfoundry" >>rules/foundries.new
+               case "$seenfoundries" in
+               */"$oldfoundry,$newfoundry"/*)
+                       ;;
+               */"$oldfoundry,"*)
+                       echo >&2 "inconsistent foundry mapping"
+                       exit 1
+                       ;;
+               *)
+                       seenfoundries=$seenfoundries$oldfoundry,$newfoundry/
+                       printf >>rules/foundries.new \
+                               "%s %s\n" "$oldfoundry" "$newfoundry"
+                       ;;
+               esac
                case "$seenrules" in
                */"$newfoundry,$key"/*)
                        exec 3>>rules/$newfoundry,$key.rules