Subject: | Making TrueType text more useful (patch incl.) |
The support for TrueType fonts by PDF::Reuse would be a lot more
useful when the output's text was searchable/copyable/extractable.
This can easily be had by supplying the "ToUnicode" option to
Text::PDF::TTFont0->new() which initiates the creation of a suitable
mapping object.
Note that this functionality of Text::PDF::TTFont0 is broken at
present (2017-11-08) and requires the patch I submitted today:
https://rt.cpan.org/Ticket/Display.html?id=123562
As for Reuse.pm, simply add the symbol to the options hash when
instantiating a TTfont0 object:
--- C:/temp/PDF-Reuse-0.39/lib/PDF/Reuse.pm 2016-09-27 17:48:32.000000000 +0200
+++ C:/temp/Reuse.pm 2017-11-08 15:28:17.784186500 +0100
@@ -1487,6 +1487,7 @@
$self->{filename},
$self->{fontAbbr},
-subset => $self->{subset},
+ ToUnicode => 1
);
$self->{ttfont}->{' subvec'} = '';