#!/usr/local/bin/perl

# Test if old and new MathTime fonts are compatible

die "Usage: mtcheck font\n" unless @ARGV == 1;

$TEXROOT = '/usr/local/tex-3.141';
$PKFONTS = "$TEXROOT/fonts/pk300";

# Don't hassle output
select(STDOUT); $| = 1;

# Walk through fontnames, regenerate them and compare
$ENV{'TEXPKS'} = ".:/usr/local/tex-3.141/extra-fonts";
foreach (`find $PKFONTS -name "$ARGV[0].*"`) {
   chop;
   ($texname, $res) = m#^.*/([^.]+)[.](.*)pk$#;
   print "mtpk $texname $res 300\n";
   system("mtpk $texname $res 300");
   system("cmp $_  $texname.${res}pk >/dev/null");
   print "$texname.${res}pk: different\n" if $?;
}






