When calling ttfont() on a PDF::API2 object with -encoding => 'utf-8', I receive a warning three times. Unfortunately I understand neither the aim of the code here, nor pack and decode well enough, to say much more.
use PDF::API2;
print "Version: $PDF::API2::VERSION\n";
my $pdf = PDF::API2->new();
$pdf->addFontDirs('var/fonts'); # some font containing directory
my $font = $pdf->ttfont('DejaVuSansMono.ttf', '-encode', 'utf-8');
Version: 2.045
Use of uninitialized value in hash element at /usr/local/share/perl/5.26.1/PDF/API2/Resource/CIDFont.pm line 290.
Use of uninitialized value in hash element at /usr/local/share/perl/5.26.1/PDF/API2/Resource/CIDFont.pm line 290.
Use of uninitialized value in hash element at /usr/local/share/perl/5.26.1/PDF/API2/Resource/CIDFont.pm line 290.
Old versions (at least 2.033-old) had a no warnings qw[ deprecated recursion uninitialized ]; in the code, so I assume that this is maybe no error. And map { unpack( 'U*', decode( $enc, pack( 'C*', $_ ) ) ) } (0..255) would do something which looks similar in outcome (to me^^), but doesn't have the gaps, but that is, as said before, just guess work...
When calling
ttfont()
on a PDF::API2 object with-encoding => 'utf-8'
, I receive a warning three times. Unfortunately I understand neither the aim of the code here, nor pack and decode well enough, to say much more.This comes from https://github.com/ssimms/pdfapi2/blob/1b998771a82aab35cd633e9ad57f9020dfaea83c/lib/PDF/API2/Resource/CIDFont.pm#L276 only returning 253 instead of 256 strings, and thus the line above mapping
(253..255)
ontoundef
.Old versions (at least 2.033-old) had a
no warnings qw[ deprecated recursion uninitialized ];
in the code, so I assume that this is maybe no error. Andmap { unpack( 'U*', decode( $enc, pack( 'C*', $_ ) ) ) } (0..255)
would do something which looks similar in outcome (to me^^), but doesn't have the gaps, but that is, as said before, just guess work...Thanks in any case and best regards, Sven