[latex3-commits] [l3svn] 01/02: Update drivers for LuaTeX v0.85

noreply at latex-project.org noreply at latex-project.org
Mon Nov 16 15:39:35 CET 2015


This is an automated email from the git hooks/post-receive script.

joseph pushed a commit to branch master
in repository l3svn.

commit 0b10b3659d29d45514612e930527b5636e72701a
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Nov 16 13:49:06 2015 +0000

    Update drivers for LuaTeX v0.85
    
    This keeps us with one PDF mode driver but with abstraction
    at the lowest level. The code for IniTeX set up still needs
    revision.
---
 l3kernel/l3drivers.dtx |   76 +++++++++++++++++++++++++++++++++++-------------
 1 file changed, 55 insertions(+), 21 deletions(-)

diff --git a/l3kernel/l3drivers.dtx b/l3kernel/l3drivers.dtx
index 844a56f..24772a1 100644
--- a/l3kernel/l3drivers.dtx
+++ b/l3kernel/l3drivers.dtx
@@ -226,9 +226,10 @@
 %   that here and later, the \texttt{dvipdfmx} documentation does not cover
 %   the |literal| key word but that this appears to behave in the same way as
 %   \pdfTeX{}'s \tn{pdfliteral} (making life easier all-round). For \pdfTeX{}
-%   and \LuaTeX{} giving direct PDF output there is a dedicated primitive.
+%   in  direct PDF output mode there is a dedicated primitive. \LuaTeX{} is
+%   almost the same but with newer versions there is a compatibly step
 %    \begin{macrocode}
-\cs_new_protected_nopar:Npn \@@_state_save:
+\cs_new_protected_nopar:Npx \@@_state_save:
 %<*dvips>
   { \tex_special:D { ps:gsave } }
 %</dvips>
@@ -236,9 +237,13 @@
   { \tex_special:D { pdf:literal~q } }
 %</dvipdfmx|xdvipdfmx>
 %<*pdfmode>
-  { \pdftex_pdfsave:D }
+  {
+    \cs_if_exist:NTF \luatex_pdfextension:D
+      { \luatex_pdfextension:D save \scan_stop: }
+      { \pdftex_pdfsave:D }
+  }
 %</pdfmode>
-\cs_new_protected_nopar:Npn \@@_state_restore:
+\cs_new_protected_nopar:Npx \@@_state_restore:
 %<*dvips>
   { \tex_special:D { ps:grestore } }
 %</dvips>
@@ -246,7 +251,11 @@
   { \tex_special:D { pdf:literal~Q } }
 %</dvipdfmx|xdvipdfmx>
 %<*pdfmode>
-  { \pdftex_pdfrestore:D }
+  {
+    \cs_if_exist:NTF \luatex_pdfextension:D
+      { \luatex_pdfextension:D restore \scan_stop: }
+      { \pdftex_pdfrestore:D }
+  }
 %</pdfmode>
 %    \end{macrocode}
 % \end{macro}
@@ -259,7 +268,7 @@
 %   be driver-specific. Note that these functions set the transformation matrix
 %   to the current position: contrast with \cs{@@_literal_direct:n}.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_literal:n #1
+\cs_new_protected:Npx \@@_literal:n #1
 %<*dvipdfmx|xdvipdfmx>
   { \tex_special:D { pdf:literal~ #1 } }
 %</dvipdfmx|xdvipdfmx>
@@ -283,7 +292,12 @@
   }
 %</dvips>
 %<*pdfmode>
-  { \pdftex_pdfliteral:D {#1} }
+  {
+    \cs_if_exist:NTF \luatex_pdfextension:D
+      { \luatex_pdfextension:D literal }
+      { \pdftex_pdfliteral:D }
+        {#1}
+  }
 %</pdfmode>
 %    \end{macrocode}
 % \end{macro}
@@ -294,7 +308,7 @@
 %   into the output. In the \texttt{(x)dvipdfmx} case this two-part keyword
 %   is documented (\emph{cf.}~|literal| alone).
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_literal_direct:n #1
+\cs_new_protected:Npx \@@_literal_direct:n #1
 %<*dvipdfmx|xdvipdfmx>
   { \tex_special:D { pdf:literal~direct~ #1 } }
 %</dvipdfmx|xdvipdfmx>
@@ -302,7 +316,12 @@
   { \tex_special:D { ps:: #1 } }
 %</dvips>
 %<*pdfmode>
-  { \pdftex_pdfliteral:D direct {#1} }
+  {
+    \cs_if_exist:NTF \luatex_pdfextension:D
+      { \luatex_pdfextension:D literal~direct }
+      { \pdftex_pdfliteral:D direct }
+        {#1}
+  }
 %</pdfmode>
 %    \end{macrocode}
 % \end{macro}
@@ -334,9 +353,14 @@
 %   part: that is always zero and so is built in here.
 %    \begin{macrocode}
 %<*!dvips>
-\cs_new_protected:Npn \@@_matrix:n #1
+\cs_new_protected:Npx \@@_matrix:n #1
 %<*pdfmode>
-  { \pdftex_pdfsetmatrix:D {#1} }
+  {
+    \cs_if_exist:NTF \luatex_pdfextension:D
+      { \luatex_pdfextension:D setmatrix }
+      { \pdftex_pdfsetmatrix:D }
+        {#1}
+  }
 %</pdfmode>
 %<*dvipdfmx|xdvipdfmx>
   { \@@_literal:n { #1 \c_space_tl 0~0~cm } }
@@ -516,24 +540,34 @@
 %   available. In all cases there is a need to reset the color after
 %   the current group.
 %    \begin{macrocode}
+\cs_new_protected_nopar:Npx \@@_color_ensure_current:
 %<*dvipdfmx|dvips|xdvipdfmx>
-\cs_new_protected_nopar:Npn \@@_color_ensure_current:
   {
-    \tex_special:D { color~push~\l_@@_current_color_tl }
-    \group_insert_after:N \@@_color_reset:
+    \tex_special:D { color~push~\exp_not:N \l_@@_current_color_tl }
+    \group_insert_after:N \exp_not:N \@@_color_reset:
+  }
+%</dvipdfmx|dvips|xdvipdfmx>
+%<*pdfmode>
+  {
+    \cs_if_exist:NTF \luatex_pdfextension:D
+      { \luatex_pdfextension:D colorstack }
+      { \pdftex_pdfcolorstack:D }
+        \exp_not:N \l_@@_color_stack_int push
+          { \exp_not:N \l_@@_current_color_tl }
+    \group_insert_after:N \exp_not:N \@@_color_reset:
   }
-\cs_new_protected_nopar:Npn \@@_color_reset:
+%</pdfmode>
+\cs_new_protected_nopar:Npx \@@_color_reset:
+%<*dvipdfmx|dvips|xdvipdfmx>
   { \tex_special:D { color~pop } }
 %</dvipdfmx|dvips|xdvipdfmx>
 %<*pdfmode>
-\cs_new_protected_nopar:Npn \@@_color_ensure_current:
   {
-    \pdftex_pdfcolorstack:D \l_@@_color_stack_int push
-      { \l_@@_current_color_tl }
-    \group_insert_after:N \@@_color_reset:
+    \cs_if_exist:NTF \luatex_pdfextension:D
+      { \luatex_pdfextension:D colorstack }
+      { \pdftex_pdfcolorstack:D }
+        \exp_not:N \l_@@_color_stack_int pop \scan_stop:
   }
-\cs_new_protected_nopar:Npn \@@_color_reset:
-  { \pdftex_pdfcolorstack:D \l_@@_color_stack_int pop \scan_stop: }
 %</pdfmode>
 %    \end{macrocode}
 % \end{macro}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the latex3-commits mailing list