summarylogtreecommitdiffstats
path: root/bug123562.patch
diff options
context:
space:
mode:
authorint2024-05-01 16:14:52 +0200
committerint2024-05-01 16:14:52 +0200
commitadc8ee90d074e7bc7d0113cdf3606cf2668ae155 (patch)
tree4d92d1b24ede8d86c7cc3631cc4c8533b6e0de74 /bug123562.patch
parentdcfca7b9d58f641b6cb760a8e24618dee1ddee15 (diff)
downloadaur-adc8ee90d074e7bc7d0113cdf3606cf2668ae155.tar.gz
Apply some patches of the Text-PDF bug-tracker.
The bug-tracker can be found at https://rt.cpan.org/Public/Dist/Display.html?Name=Text-PDF The number in the patch-filename refers to the specific bug-id there. Note: I first apply the patch of bug-id 124350 and afterwards bug-id 123562. So the changes that were already applied from the first patch are not a part of the second one. So the patch in the bug-tracker differs accordingly from bug123562.patch provided in the package.
Diffstat (limited to 'bug123562.patch')
-rw-r--r--bug123562.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/bug123562.patch b/bug123562.patch
new file mode 100644
index 000000000000..21261518f8ec
--- /dev/null
+++ b/bug123562.patch
@@ -0,0 +1,43 @@
+--- a/lib/Text/PDF/TTFont0.pm 2018-02-02 15:27:58.315775700 +0200
++++ b/lib/Text/PDF/TTFont0.pm 2019-07-17 08:25:04.000000000 +0200
+@@ -106,25 +106,28 @@
+ if ($opt{'ToUnicode'})
+ {
+ @rev = $font->{'cmap'}->read->reverse;
+- $unistr = '/CIDInit /ProcSet findresource being 12 dict begin begincmap
++ my $num = grep defined, @rev;
++ $unistr = '/CIDInit /ProcSet findresource begin 12 dict begin begincmap
+ /CIDSystemInfo << /Registry (' . $self->{'BaseFont'}->val . '+0) /Ordering (XYZ)
+ /Supplement 0 >> def
+ /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++)
++1 begincodespacerange <0000> <FFFF> endcodespacerange'."\n";
++ for (my $i = my $j = 0; $i < @rev; $i++, $j++)
+ {
+- if ($i % 100 == 0)
++ next unless defined $rev[$i];
++ my $s = $num - $j > 100 ? 100 : $num - $j;
++ if ($j == 0)
+ {
+- $unistr .= "endbfrange\n";
+- $unistr .= $num - $i > 100 ? 100 : $num - $i;
+- $unistr .= " beginbfrange\n";
++ $unistr .= "$s beginbfchar\n";
+ }
+- $unistr .= sprintf("<%04X> <%04X> <%04X>\n", $i, $i, $rev[$i]);
++ elsif ($j % 100 == 0)
++ {
++ $unistr .= "endbfchar\n";
++ $unistr .= "$s beginbfchar\n";
++ }
++ $unistr .= sprintf("<%04X> <%04X>\n", $i, $rev[$i]);
+ }
+- $unistr .= "endbfrange\nendcmap CMapName currendict /CMap defineresource pop end end\n";
++ $unistr .= "endbfchar\nendcmap CMapName currendict /CMap defineresource pop end end\n";
+ $touni = PDFDict();
+ $parent->new_obj($touni);
+ $touni->{' stream'} = $unistr;