Skip Menu |

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

Report information
The Basics
Id: 124350
Status: new
Priority: 0/
Queue: Text-PDF

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

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



Subject: Output Uppercase CIDs in ToUnicode CMaps (patch incl.)
The CIDs in ToUnicode CMaps generated by Text::PDF::TTFont0 use lowercase hex values while the out_text() function prints them in uppercase. Apparently, this confuses PDF clients which are unable to create the mappings. The trivial fix aligns the sprintf format templates in line with the PDF reference docs which use all-uppercase CIDs. --- C:/usr/local/perl5/cpan/build/Text-PDF-0.31-eAExzd/lib/Text/PDF/TTFont0.pm 2016-08-04 19:49:53.000000000 +0200 +++ c:/usr/local/perl5/site/lib/Text/PDF/TTFont0.pm 2018-02-02 15:27:58.315775700 +0100 @@ -109,9 +109,11 @@ $unistr = '/CIDInit /ProcSet findresource being 12 dict begin begincmap /CIDSystemInfo << /Registry (' . $self->{'BaseFont'}->val . '+0) /Ordering (XYZ) /Supplement 0 >> def -/CMapName /' . $self->{'BaseFont'}->val . '+0 def -1 begincodespacerange <'; - $unistr .= sprintf("%04x> <%04x> endcodespacerange\n", 1, $num - 1); +/CMapName /' . $self->{'BaseFont'}->val . '+0 def /CMapType 2 def +1 begincodespacerange '; + $unistr .= sprintf("<%04X> <%04X> endcodespacerange\n", 1, $num - 1); + $unistr .= $num - $i > 100 ? 100 : $num - $i; + $unistr .= " beginbfrange\n"; for ($i = 1; $i < $num; $i++) { if ($i % 100 == 0) @@ -120,9 +122,9 @@ $unistr .= $num - $i > 100 ? 100 : $num - $i; $unistr .= " beginbfrange\n"; } - $unistr .= sprintf("<%04x> <%04x> <%04x>\n", $i, $i, $rev[$i]); + $unistr .= sprintf("<%04X> <%04X> <%04X>\n", $i, $i, $rev[$i]); } - $unistr .= "endbfrange\nendcmap CMapName currendict /CMap defineresource pop end end"; + $unistr .= "endbfrange\nendcmap CMapName currendict /CMap defineresource pop end end\n"; $touni = PDFDict(); $parent->new_obj($touni); $touni->{' stream'} = $unistr;