summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/cmap
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-02-06 22:29:55 +0000
committerKarl Berry <karl@freefriends.org>2021-02-06 22:29:55 +0000
commit0ebddddd3b7866f3396daa390deed3d964f4b381 (patch)
tree87a4c183f10876139fa6d23d56a32078e410a5b2 /Master/texmf-dist/tex/latex/cmap
parenta6cd75438fbcaade92377c09f1656838f98d34bd (diff)
cmap (6feb21)
git-svn-id: svn://tug.org/texlive/trunk@57640 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/cmap')
-rw-r--r--Master/texmf-dist/tex/latex/cmap/cmap.sty44
1 files changed, 35 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/cmap/cmap.sty b/Master/texmf-dist/tex/latex/cmap/cmap.sty
index f77cc99d61e..104468d84ff 100644
--- a/Master/texmf-dist/tex/latex/cmap/cmap.sty
+++ b/Master/texmf-dist/tex/latex/cmap/cmap.sty
@@ -11,7 +11,7 @@
% Werner Lemberg
% Oleg Katsitadze
-\ProvidesPackage{cmap}[2021/01/29 v1.0i CMap support: searchable PDF]
+\ProvidesPackage{cmap}[2021/02/06 v1.0j CMap support: searchable PDF]
\DeclareOption{resetfonts}{%
\@for\reserved@a:=%
@@ -26,12 +26,27 @@
\ProcessOptions
\@ifundefined{pdffontattr}{%
-% The cmap package can be used only with pdflatex,
+ \@ifundefined{pdfextension}{%
+% The cmap package can be used only with pdflatex and lualatex,
% but not with ordinary latex
- \PackageWarningNoLine{cmap}{pdftex not detected - exiting}%
- \endinput
-}\relax
-\ifnum\pdfoutput<1
+ \PackageWarningNoLine{cmap}{pdftex not detected - exiting}%
+ \endinput
+ }{%
+ \protected\def\cmap@pdfobj{\pdfextension obj }%
+ \protected\def\cmap@fontattr{\pdfextension fontattr }%
+ \def\cmap@lastobj{\number\pdffeedback lastobj \space 0 R}%
+ }%
+}{%
+ \let\cmap@pdfobj\pdfobj
+ \let\cmap@fontattr\pdffontattr
+ \def\cmap@lastobj{\number\pdflastobj\space 0 R}%
+}
+
+\@ifundefined{pdfoutput}{%
+ \ifnum\outputmode<1
+}{%
+ \ifnum\pdfoutput<1
+}%
\PackageWarningNoLine{cmap}{pdftex in DVI mode - exiting}
\expandafter\endinput
\fi
@@ -45,6 +60,17 @@
%\PackageWarningNoLine{cmap}{babel already loaded - some fonts may be unprocessed}%
%}\relax
+\@ifundefined{pdfnobuiltintounicode}{%
+ \@ifundefined{pdfgentounicode}\relax{%
+ \pdfgentounicode=0
+ }%
+ \protected\def\cmap@nobuiltintounicode{%
+ \expandafter\@gobble\the
+ }%
+}{%
+ \let\cmap@nobuiltintounicode\pdfnobuiltintounicode
+}
+
\def\extract@font{%
\get@external@font
\global\expandafter\font\font@name\external@font\relax
@@ -58,12 +84,12 @@
\edef\reserved@f{\lowercase{\def\noexpand\reserved@f{\cmap@f@encoding.cmap}}}%
\reserved@f
\IfFileExists{\reserved@f}{%
- \immediate\pdfobj stream
+ \immediate\cmap@pdfobj stream
%attr {/Type /CIDFile}
file {\reserved@f}%
\expandafter\xdef\csname cmap@set@\cmap@f@encoding\endcsname{%
- \pdfnobuiltintounicode\noexpand\font@name
- \noexpand\expandafter\pdffontattr\noexpand\font@name{/ToUnicode \the\pdflastobj\space 0 R}}%
+ \cmap@nobuiltintounicode\noexpand\font@name
+ \noexpand\expandafter\cmap@fontattr\noexpand\font@name{/ToUnicode \cmap@lastobj}}%
}{%
\global\expandafter\let\csname cmap@set@\cmap@f@encoding\endcsname\empty
}%