--- C:\Documents and Settings\All Users\Documenten\Downloads\Font\AFM.pm Sun Dec 25 22:20:34 2005 +++ C:\PERL\site\lib\Font\AFM.pm Wed Jun 27 08:26:12 2001 @@ -192,10 +192,14 @@ # The metrics_path is used to locate metrics files # -my $metrics_path = $ENV{METRICS} || - "/usr/lib/afm:/usr/local/lib/afm:/usr/openwin/lib/fonts/afm/:."; -my @metrics_path = split(/:/, $metrics_path); -foreach (@metrics_path) { s,/$,, } # reove trailing slashes +use Config; +my $path_sep = $Config{path_sep}; +my $metrics_path = $ENV{METRICS} || join $path_sep, grep -d, + '/usr/lib/afm', '/usr/local/lib/afm', '/usr/openwin/lib/fonts/afm/', '.', + map "$_/Font/afm", @INC; +$metrics_path =~ tr&\\&/& if $path_sep eq ';'; +my @metrics_path = split(/$path_sep/, $metrics_path); +foreach (@metrics_path) { s,/$,, } # remove trailing slashes @ISOLatin1Encoding = qw( .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef @@ -253,7 +257,10 @@ } } } - open(AFM, $file) or croak "Can't find the AFM file for $fontname"; + open(AFM, $file) or do { + local $" = ':'; + croak "Can't find the AFM file for $fontname\nSearched in @metrics_path."; + }; my $self = bless { }, $class; local($/, $_) = ("\n", undef); # ensure correct $INPUT_RECORD_SEPARATOR while () {