[PATCH] to AFM.PM for OpenVMS

Brad Hughes (brad@tmc.naecker.com)
Tue, 16 Sep 1997 10:42:06 +0000


AFM files are kept in the SYS$PS_FONT_METRICS directory
on OpenVMS.  The following patch to the AFM.PM found in
LIBWWW-PERL-5_10 deals with it:

---------- begin patch -------------
*** afm.pm;1
--- afm.pm;2
**************
*** 236,241
  sub new
  {
     my($class, $fontname) = @_;
     $fontname =~ s/.amf$//;
     my $file = "$fontname.afm";
     unless ($file =~ m,^/,) {
--- 236,242 -----
  sub new
  {
     my($class, $fontname) = @_;
+    my $file;
     $fontname =~ s/.amf$//;
     if ($^O eq 'VMS') {
       $file = "sys\$ps_font_metrics:$fontname.afm";
**************
*** 237,244
  {
     my($class, $fontname) = @_;
     $fontname =~ s/.amf$//;
!    my $file = "$fontname.afm";
!    unless ($file =~ m,^/,) {
         # not absolute, search the metrics path for the file
         foreach (@metrics_path) {
           if (-f "$_/$file") {
--- 238,249 -----
     my($class, $fontname) = @_;
     my $file;
     $fontname =~ s/.amf$//;
!    if ($^O eq 'VMS') {
!      $file = "sys\$ps_font_metrics:$fontname.afm";
!    }
!    else {
!      $file = "$fontname.afm";
!      unless ($file =~ m,^/,) {
         # not absolute, search the metrics path for the file
         foreach (@metrics_path) {
         if (-f "$_/$file") {
**************
*** 241,250
     unless ($file =~ m,^/,) {
         # not absolute, search the metrics path for the file
         foreach (@metrics_path) {
!          if (-f "$_/$file") {
!              $file = "$_/$file";
!              last;
!          }
         }
     }
     open(AFM, $file) or croak "Can't find the AFM file for $fontname";
--- 246,255 -----
       unless ($file =~ m,^/,) {
         # not absolute, search the metrics path for the file
         foreach (@metrics_path) {
!        if (-f "$_/$file") {
!          $file = "$_/$file";
!          last;
!        }
         }
       }
     }
**************
*** 246,251
               last;
           }
         }
     }
     open(AFM, $file) or croak "Can't find the AFM file for $fontname";
     my $this = bless { }, $class;
--- 251,257 -----
           last;
         }
         }
+      }
     }
     open(AFM, $file) or croak "Can't find the AFM file for $fontname";
     my $this = bless { }, $class;
----------- end patch --------------------