This queue is for tickets about the PDF-API2 CPAN distribution.

Report information
The Basics
Id:
66054
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
cnhacktnt [...] cpan.org
Cc:
AdminCc:

BugTracker
Severity:
Important
Broken in:
2.016
Fixed in:
(no value)



Subject: CJKFonts' cmap files can't be loaded.
Hi, I found that PDF::API2::Resource::CIDFont::CJKFont can't load specified cmap file properly, for example: $pdf->cjkfont('simplified'); it will always tell you that "requested cmap 'simplified' not installed", related code in CJKFont.pm: --- sub _look_for_cmap ($) { ... eval "require PDF::API2::Resource::CIDFont::CMap::$fname; "; ... } so if I specified 'simplified' for cjkfont(), then above "eval" equals: --- eval "require PDF::API2::Resource::CIDFont::CMap::simplified; "; But in PDF/API2/Resource/CIDFont/CMap/, there is no .pm file, they are all .cmap files, I think this bug should be easily sovled by rename all *.cmap to *.pm in that directory. Thanks!
On Tue Feb 22 20:46:22 2011, CNHACKTNT wrote:
Show quoted text
> But in PDF/API2/Resource/CIDFont/CMap/, there is no .pm file, they are > all .cmap files, I > think this bug should be easily sovled by rename all *.cmap to *.pm > in that directory.
Well, this bug got introduced because someone else pointed out that they shouldn't be .pm files since they're not modules. :-) What should work, though, is changing the require statement to look for the .cmap files instead: diff -r 94b0455432fe lib/PDF/API2/Resource/CIDFont/CJKFont.pm --- a/lib/PDF/API2/Resource/CIDFont/CJKFont.pm Tue Feb 22 20:24:24 2011 -0500 +++ b/lib/PDF/API2/Resource/CIDFont/CJKFont.pm Tue Feb 22 20:58:44 2011 -0500 @@ -75,7 +75,7 @@ my $fname=lc(shift); $fname=~s/[^a-z0-9]+//gi; return({%{$cmap->{$fname}}}) if(defined $cmap->{$fname}); - eval "require PDF::API2::Resource::CIDFont::CMap::$fname; "; + eval "require \"PDF/API2/Resource/CIDFont/CMap/$fname.cmap\""; unless($@){ return({%{$cmap->{$fname}}}); } else { That seems to work on my end, so I'll commit it (along with an identical change in CIDFont/TrueType/FontFile.pm) and hope it doesn't break anything else. Let me know if it causes you any problems.
This is fixed in 2.017, just released.
On Tue Feb 22 22:57:49 2011, SSIMMS wrote:
Show quoted text
> This is fixed in 2.017, just released.
You rocks! Thanks! :-)


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.