#!/usr/bin/perl -w

&Hilfe if ($#ARGV<0);

foreach $file (@ARGV)
{
  unless ($file =~ /(.*)\.pfb$/)
  {
    print "'$file' ist kein PFB-Font!\n";
    next;
  }
  $ohneendung = $1;
  $ziel = $ohneendung.'.afm';
  if (-e $ziel)
  {
    print "Zieldatei '$ziel' existiert bereits!\n";
    next;
  }
  print "Erstelle AFM für $file...\n";
  system("gs -q -dNODISPLAY -- printafm.ps $file > $ziel");
}


sub Hilfe
{
  print
"
pfb2afm 1.0   -   von Stephan Löscher
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Syntax: pfb2afm font1.pfb font2.pfb ...

Es wird aus den *.pfb-Fonts der Adobe Fontmetrik *.afm errechnet und als Datei
gespeichert.
Beispiel: Aus capri.pfb wird capri.afm erstellt.
Typischer Aufruf: pfb2afm *

";
exit;
}
