Subject: | Priority of upr files in PostScript::Resources |
Hi,
It seems to me that the handling of the default path (::) doesn't conform to the specs: The priority of the upr files is reversed, because locations found later in the path overwrite the locations found earlier.
I've used the following little test program:
use PostScript::Resources;
$rsc = PostScript::Resources->new(stdpath => "/usr/local/share/fonts");
print $rsc->FontOutline("PrestigeElite"), "\n";
Now, if, for example,
- the directories /home/mxp/lib/fonts and /usr/local/share/fonts both contain PSres.upr files and the font PrestigeElite, and
- PSRESOURCEPATH is set to "::/home/mxp/lib/fonts",
the test program prints "/home/mxp/lib/fonts/PrestigeElite" instead of "/usr/local/share/fonts/PrestigeElite".
I've attached a patch - I might have missed something, but it fixes the problem for me.
Greetings,
Michael
*** Resources.pm.orig Tue Dec 14 01:32:35 2004
--- Resources.pm Tue Dec 14 01:25:03 2004
***************
*** 284,288 ****
# PostScriptName=the/file.afm
if ( $line =~ /^([^=]+)=(.*)$/ ) {
! $afm->{$1} = $rscidx.$2;
next;
}
--- 284,288 ----
# PostScriptName=the/file.afm
if ( $line =~ /^([^=]+)=(.*)$/ ) {
! $afm->{$1} = $rscidx.$2 unless $afm->{$1};
next;
}
***************
*** 331,335 ****
# PostScriptName=the/file.pfa
if ( $line =~ /^([^=]+)=(.*)$/ ) {
! $pfa->{$1} = $rscidx.$2;
next;
}
--- 331,335 ----
# PostScriptName=the/file.pfa
if ( $line =~ /^([^=]+)=(.*)$/ ) {
! $pfa->{$1} = $rscidx.$2 unless $pfa->{$1};
next;
}