summaryrefslogtreecommitdiff
path: root/tex/context/base/enco-pfr.tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/enco-pfr.tex')
-rw-r--r--tex/context/base/enco-pfr.tex46
1 files changed, 35 insertions, 11 deletions
diff --git a/tex/context/base/enco-pfr.tex b/tex/context/base/enco-pfr.tex
index 199d48fd3..24044e4d0 100644
--- a/tex/context/base/enco-pfr.tex
+++ b/tex/context/base/enco-pfr.tex
@@ -11,6 +11,10 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\beginXETEX
+ \endinput
+\endXETEX
+
\ifx\pdffontresource\undefined\else\endinput\fi
\writestatus{loading}{Context Encoding Macros (pdf)}
@@ -45,8 +49,6 @@
%D of the fonts and either flush the information at shipout
%D time, or at the end of the document.
-\unprotect
-
%D \macros
%D {ifincludepdffontresources}
%D
@@ -54,6 +56,24 @@
\newif\ifincludepdffontresources \includepdffontresourcestrue
+\ifx\pdfglyphtounicode\undefined \else \loadmarkfile{enco-pfr} \fi
+
+% somehow we cannot preload this beast; also, it's mk dependent
+%
+% \appendtoks
+% \doifelse{\jobsuffix}{pdf}{\loadmkiifile{pdfr-def.tex}}%
+% \to \everystarttext
+
+% ugly, this should go to the driver spec-tpd
+
+\ifx\pdfgentounicode\undefined \else
+ \ifcase\pdfgentounicode \else
+ \expandafter \expandafter \expandafter \endinput
+ \fi
+\fi
+
+\unprotect
+
% a problem is that there is always an ec vector added even when
% we switch to texnansi early; this has to do with the fact that
% we need to setup fonts at startup; this a pain when we have
@@ -195,16 +215,20 @@
% \fi}
\def\includepdffontresource
- {\ifincludepdffontresources
- \expandafter\ifx\the\font\nullfont \else
- \ifx\pdffontattr\undefined
- % we're not using (a recent version of) pdftex
- \else\ifcase\pdfoutput
- % we're not in pdf mode
- \else
- \doincludepdffontresource
- \fi\fi
+ {\ifcase\pdfgentounicode
+ \ifincludepdffontresources
+ \expandafter\ifx\the\font\nullfont \else
+ \ifx\pdffontattr\undefined
+ % we're not using (a recent version of) pdftex
+ \else\ifcase\pdfoutput
+ % we're not in pdf mode
+ \else
+ \doincludepdffontresource
+ \fi\fi
+ \fi
\fi
+ \or
+ \global\let\includepdffontresource\relax % automatic, built in
\fi}
\def\dododoincludepdffontresource#1% encoding