diff options
author | Norbert Preining <norbert@preining.info> | 2021-02-07 03:00:48 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-02-07 03:00:48 +0000 |
commit | e068841d2fc2976d094b382e4dd5e4d6df455506 (patch) | |
tree | a10b009fa5e01a531fa1eb92723f24ae05ba6d4e /macros/latex/contrib/cmap/cmap.sty | |
parent | 27accb929aa8061d3aea791560a1bffd3876f0c7 (diff) |
CTAN sync 202102070300
Diffstat (limited to 'macros/latex/contrib/cmap/cmap.sty')
-rw-r--r-- | macros/latex/contrib/cmap/cmap.sty | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/macros/latex/contrib/cmap/cmap.sty b/macros/latex/contrib/cmap/cmap.sty index f77cc99d61..104468d84f 100644 --- a/macros/latex/contrib/cmap/cmap.sty +++ b/macros/latex/contrib/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 }% |