[latex3-commits] [git/LaTeX3-latex3-latex2e] tounicode_everyjob: Adapt code from jfbu for improving preload speed (7b3db88b)

Marcel Fabian Krüger tex at 2krueger.de
Thu Feb 25 18:39:21 CET 2021


Repository : https://github.com/latex3/latex2e
On branch  : tounicode_everyjob
Link       : https://github.com/latex3/latex2e/commit/7b3db88bbc5a964ee92e68891583bcf63030ed06

>---------------------------------------------------------------

commit 7b3db88bbc5a964ee92e68891583bcf63030ed06
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Thu Feb 25 18:39:21 2021 +0100

    Adapt code from jfbu for improving preload speed


>---------------------------------------------------------------

7b3db88bbc5a964ee92e68891583bcf63030ed06
 base/changes.txt |  6 ++++++
 base/ltfinal.dtx | 17 ++++++-----------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 6be36a76..e9d856a3 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,12 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2021-02-25  Marcel Krüger  <Marcel.Krueger at latex-project.org>
+
+	* ltfinal.dtx:
+	Improve speed of compatibility code for preloading \pdfglyphtounicode
+	into \everyjob
+
 2021-02-19  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* ltoutenc.dtx (subsection{Definitions for the TU encoding}):
diff --git a/base/ltfinal.dtx b/base/ltfinal.dtx
index 12b65318..d6fa6e8a 100644
--- a/base/ltfinal.dtx
+++ b/base/ltfinal.dtx
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltfinal.dtx}
-             [2021/01/21 v2.2l LaTeX Kernel (Final Settings)]
+             [2021/02/25 v2.2m LaTeX Kernel (Final Settings)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltfinal.dtx}
@@ -569,6 +569,7 @@
 %   For pdf\TeX\ preload and enable automatic glyph to Unicode mapping
 %   for more reliable copy and paste support.
 %   \changes{v2.2l}{2021/01/21}{Load glyphtounicode.tex for pdf\TeX}
+%   \changes{v2.2m}{2021/02/25}{Improve speed of ToUnicode everyjob loading code}
 %
 %    \begin{macrocode}
 %</2ekernel>
@@ -588,16 +589,10 @@
 %<*2ekernel>
   \else
     \begingroup
-      \toks@\expandafter{\the\everyjob}%
-      \openin0"glyphtounicode"
-      \loop\unless\ifeof0
-        \read0 to \glyphline
-        \toks@\expandafter{\the\expandafter\toks@\glyphline}%
-      \repeat
-      \closein0
-      \expandafter
-    \endgroup
-    \expandafter\everyjob\expandafter{\the\toks@}%
+      \everyeof{\noexpand}\endlinechar-1
+      \edef\x{\endgroup
+        \everyjob{\the\everyjob\@@input glyphtounicode }%
+    }\x
   \fi
 %</2ekernel>
   \pdfgentounicode=1





More information about the latex3-commits mailing list.