Skip Menu |

This queue is for tickets about the PostScript-Font CPAN distribution.

Report information
The Basics
Id: 8853
Status: resolved
Priority: 0/
Queue: PostScript-Font

People
Owner: Nobody in particular
Requestors: mxp [...] dynalabs.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.09
Fixed in: (no value)



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; }
From: Johan Vromans <jvromans [...] squirrel.nl>
Date: Fri, 17 Dec 2004 22:54:55 +0100
To: bug-PostScript-Font [...] rt.cpan.org
Subject: Re: [cpan #8853] Priority of upr files in PostScript::Resources
RT-Send-Cc:
Hi Michael, [Quoting Michael_Piotrowski via RT, on December 13 2004, 20:13, in "[cpan #8853] Priorit"] Show quoted text
> 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'd say that follows the documentation, in particular: "Users with private resources should end the path with a double colon if they want their resources to override the system defaults, or begin it with a double colon if they don't want to override system defaults." As I understand it, overriding information by later entries in intentional. -- Johan
Hi Johan, [jvromans@squirrel.nl - Fri Dec 17 17:38:36 2004]: Show quoted text
> I'd say that follows the documentation, in particular: > > "Users with private resources should end the path with a double colon > if they want their resources to override the system defaults, or > begin > it with a double colon if they don't want to override system > defaults." > > As I understand it, overriding information by later entries in > intentional.
Well, I understand that the components in PSRESOURCEPATH are read from left to right, and that the first matching resource will be used (just like the behavior for PATH): Users with private resources should end the path with a double colon if they want their resources to override the system defaults, means to me a setting like PSRESOURCEPATH=/private/psres:: Here, the path *ends* with ::, and my private resources should override the system defaults. The same goes for or begin it with a double colon if they don't want to override system defaults. which means to me a setting like PSRESOURCEPATH=::/private/psres Here the path *begins* with ::, and my private resources should *not* override system default, i.e., they're only searched if no match was found in a preceding path component. Greetings
From: Johan Vromans <jvromans [...] squirrel.nl>
Date: Sat, 18 Dec 2004 17:50:34 +0100
To: bug-PostScript-Font [...] rt.cpan.org
Subject: Re: [cpan #8853] Priority of upr files in PostScript::Resources
RT-Send-Cc:
Show quoted text
> Well, I understand that the components in PSRESOURCEPATH are read from > left to right, and that the first matching resource will be used (just > like the behavior for PATH): > > Users with private resources should end the path with a double > colon if they want their resources to override the system defaults, > > means to me a setting like > > PSRESOURCEPATH=/private/psres:: > > Here, the path *ends* with ::, and my private resources should override > the system defaults.
I guess you're right. I must have misinterpreted this one. I've applied your change and uploaded a new version. Thanks! -- Johan
[jvromans@squirrel.nl - Sat Dec 18 11:54:16 2004]: Show quoted text
> I've applied your change and uploaded a new version.
Great, thanks!