Skip to content

Commit

Permalink
Rename xdvipdfmx backend to xetex
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Aug 30, 2020
1 parent 9b88b3f commit ccfbf74
Show file tree
Hide file tree
Showing 26 changed files with 95 additions and 88 deletions.
4 changes: 4 additions & 0 deletions l3backend/CHANGELOG.md
Expand Up @@ -6,6 +6,10 @@ this project uses date-based 'snapshot' version identifiers.

## [Unreleased]

### Changed
- Split `pdfmode` driver into pdfTeX- and LuaTeX-specific files
- Renamed `xdvipdfmx` backend files to `xetex`

## [2020-08-07]

### Changed
Expand Down
22 changes: 11 additions & 11 deletions l3backend/l3backend-basics.dtx
Expand Up @@ -89,10 +89,10 @@
{l3backend-pdftex.def}{2020-08-07}{}
{L3 backend support: PDF output (pdfTeX)}
%</pdftex>
%<*xdvipdfmx>
{l3backend-xdvipdfmx.def}{2020-08-07}{}
{L3 backend support: xdvipdfmx}
%</xdvipdfmx>
%<*xetex>
{l3backend-xetex.def}{2020-08-07}{}
{L3 backend support: XeTeX}
%</xetex>
% \end{macrocode}
%
% The order of the backend code here is such that we get somewhat logical
Expand All @@ -101,9 +101,9 @@
% are shared are
% \begin{itemize}
% \item Color support is either \texttt{dvips}-like or \LuaTeX{}/pdfTeX{}-like.
% \item \LuaTeX{}/pdfTeX{} and \texttt{(x)dvipdfmx} share drawing routines.
% \item \texttt{xdvipdfmx} is largely the same as \texttt{dvipdfmx} so
% takes most of the same code.
% \item \LuaTeX{}/pdfTeX{} and \texttt{dvipdfmx}/\XeTeX{} share drawing routines.
% \item \XeTeX{} is the same as \texttt{dvipdfmx} other than image size
% extraction so takes most of the same code.
% \end{itemize}
%
% \begin{macro}
Expand Down Expand Up @@ -312,13 +312,13 @@
% \subsection{\texttt{dvipdfmx} backend}
%
% \begin{macrocode}
%<*dvipdfmx|xdvipdfmx>
%<*dvipdfmx|xetex>
% \end{macrocode}
%
% The \texttt{dvipdfmx} shares code with the PDF mode one (using the common
% section to this file) but also with \texttt{xdvipdfmx}. The latter is close
% section to this file) but also with \XeTeX{}. The latter is close
% to identical to \texttt{dvipdfmx} and so all of the code here is extracted
% for both backends, with some \texttt{clean up} for \texttt{xdvipdfmx} as
% for both backends, with some \texttt{clean up} for \XeTeX{} as
% required.
%
% \begin{macro}{\__kernel_backend_literal_pdf:n, \__kernel_backend_literal_pdf:x}
Expand Down Expand Up @@ -351,7 +351,7 @@
% \end{macro}
%
% \begin{macrocode}
%</dvipdfmx|xdvipdfmx>
%</dvipdfmx|xetex>
% \end{macrocode}
%
% \subsection{\texttt{dvisvgm} backend}
Expand Down
4 changes: 2 additions & 2 deletions l3backend/l3backend-box.dtx
Expand Up @@ -253,7 +253,7 @@
% \subsection{\texttt{dvipdfmx} backend}
%
% \begin{macrocode}
%<*dvipdfmx|xdvipdfmx>
%<*dvipdfmx|xetex>
% \end{macrocode}
%
% \begin{macro}{\@@_backend_clip:N}
Expand Down Expand Up @@ -327,7 +327,7 @@
% \end{macro}
%
% \begin{macrocode}
%</dvipdfmx|xdvipdfmx>
%</dvipdfmx|xetex>
% \end{macrocode}
%
% \subsection{\texttt{dvisvgm} backend}
Expand Down
14 changes: 7 additions & 7 deletions l3backend/l3backend-color.dtx
Expand Up @@ -64,14 +64,14 @@
% one directly linked to drawings (or rather the split between filling
% and stroking). General color is relatively easy to handle: we have a color
% stack available with all modern drivers, and can use that.
% Whilst \texttt{(x)dvipdfmx} does have its own approach to color specials,
% Whilst \texttt{dvipdfmx}/\XeTeX{} does have its own approach to color specials,
% it is easier to use \texttt{dvips}-like ones for all cases except direct
% PDF output.
%
% \subsection{\texttt{dvips}-style}
%
% \begin{macrocode}
%<*dvisvgm|dvipdfmx|dvips|xdvipdfmx>
%<*dvisvgm|dvipdfmx|dvips|xetex>
% \end{macrocode}
%
% \begin{macro}{\@@_backend_pickup:N}
Expand Down Expand Up @@ -148,7 +148,7 @@
% \end{macro}
%
% \begin{macrocode}
%</dvisvgm|dvipdfmx|dvips|xdvipdfmx>
%</dvisvgm|dvipdfmx|dvips|xetex>
% \end{macrocode}
%
% \subsection{\LuaTeX{} and \pdfTeX{}}
Expand Down Expand Up @@ -263,13 +263,13 @@
%
% \subsection{Fill and stroke color}
%
% Here, \texttt{(x)dvipdfmx} follows \LuaTeX{} and \pdfTeX{},
% Here, \texttt{dvipdfmx}/\XeTeX{} follows \LuaTeX{} and \pdfTeX{},
% while for \texttt{dvips}
% we have to manage fill and stroke color ourselves. We also handle
% \texttt{dvisvgm} independently, as there we can create SVG directly.
%
% \begin{macrocode}
%<*dvipdfmx|luatex|pdftex|xdvipdfmx>
%<*dvipdfmx|luatex|pdftex|xetex>
% \end{macrocode}
%
% \begin{macro}
Expand All @@ -281,7 +281,7 @@
% \@@_backend_stroke_gray:n ,
% \@@_backend_stroke_rgb:n
% }
% Drawing (fill/stroke) color is handled in \texttt{(x)dvipdfmx} in the
% Drawing (fill/stroke) color is handled in \texttt{dvipdfmx}/\XeTeX{} in the
% same way as \LuaTeX{}/\pdfTeX{}. We use the same approach as earlier, except the
% color stack is not involved so the generic direct PDF operation is used.
% There is no worry about the nature of strokes: everything is handled
Expand Down Expand Up @@ -316,7 +316,7 @@
% \end{macro}
%
% \begin{macrocode}
%</dvipdfmx|luatex|pdftex|xdvipdfmx>
%</dvipdfmx|luatex|pdftex|xetex>
% \end{macrocode}
%
% \begin{macrocode}
Expand Down
36 changes: 18 additions & 18 deletions l3backend/l3backend-draw.dtx
Expand Up @@ -339,7 +339,7 @@
% In \texttt{dvips}, keeping the transformations in line with the engine
% is unfortunately not possible for scaling and rotations: even if we
% decompose the matrix into those operations, there is still no backend
% tracking (\emph{cf.}~\texttt{(x)dvipdfmx}). Thus we take the shortest
% tracking (\emph{cf.}~\texttt{dvipdfmx}/\XeTeX{}). Thus we take the shortest
% path available and simply dump the matrix as given.
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_cm:nnnn #1#2#3#4
Expand Down Expand Up @@ -393,13 +393,13 @@
%</dvips>
% \end{macrocode}
%
% \subsection{\LuaTeX{}, \pdfTeX{} and \texttt{(x)dvipdfmx}}
% \subsection{\LuaTeX{}, \pdfTeX{}, \texttt{dvipdfmx} and \XeTeX{}}
%
% \LuaTeX{}, \pdfTeX{} and \texttt{(x)dvipdfmx} directly produce PDF output
% \LuaTeX{}, \pdfTeX{}, \texttt{dvipdfmx} and \XeTeX{} directly produce PDF output
% and understand a shared set of specials for drawing commands.
%
% \begin{macrocode}
%<*dvipdfmx|luatex|pdftex|xdvipdfmx>
%<*dvipdfmx|luatex|pdftex|xetex>
% \end{macrocode}
%
% \subsubsection{Drawing}
Expand Down Expand Up @@ -575,25 +575,25 @@
%
% \begin{macro}{\@@_backend_cm:nnnn}
% \begin{macro}{\@@_backend_cm_aux:nnnn}
% Another split here between \LuaTeX{}/pdfTeX{} and \texttt{(x)dvipdfmx}.
% Another split here between \LuaTeX{}/pdfTeX{} and \texttt{dvipdfmx}/\XeTeX{}.
% In the former, we have a direct method to maintain alignment: the backend
% can use a matrix itself. For \texttt{(x)dvipdfmx}, we can to decompose the
% can use a matrix itself. For \texttt{dvipdfmx}/\XeTeX{}, we can to decompose the
% matrix into rotations and a scaling, then use those operations as they
% are handled by the backend. (There is backend support for matrix operations in
% \texttt{(x)dvipdfmx}, but as a matched pair so not suitable for the
% \texttt{dvipdfmx}/\XeTeX{}, but as a matched pair so not suitable for the
% \enquote{stand alone} transformation set up here.)
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_cm:nnnn #1#2#3#4
{
%<*luatex|pdftex>
\__kernel_backend_matrix:n { #1 ~ #2 ~ #3 ~ #4 }
%</luatex|pdftex>
%<*dvipdfmx|xdvipdfmx>
%<*dvipdfmx|xetex>
\@@_backend_cm_decompose:nnnnN {#1} {#2} {#3} {#4}
\@@_backend_cm_aux:nnnn
%</dvipdfmx|xdvipdfmx>
%</dvipdfmx|xetex>
}
%<*dvipdfmx|xdvipdfmx>
%<*dvipdfmx|xetex>
\cs_new_protected:Npn \@@_backend_cm_aux:nnnn #1#2#3#4
{
\__kernel_backend_literal:x
Expand All @@ -617,7 +617,7 @@
{ \fp_eval:n { round ( -#4 , 5 ) } }
}
}
%</dvipdfmx|xdvipdfmx>
%</dvipdfmx|xetex>
% \end{macrocode}
% \end{macro}
% \end{macro}
Expand Down Expand Up @@ -677,7 +677,7 @@
% way of specifying a transformation matrix exchanges where one would
% normally expect $B$ and $C$ to be.
% \begin{macrocode}
%<*dvipdfmx|xdvipdfmx>
%<*dvipdfmx|xetex>
\cs_new_protected:Npn \@@_backend_cm_decompose:nnnnN #1#2#3#4#5
{
\use:x
Expand Down Expand Up @@ -720,7 +720,7 @@
{ #5 {#1} {#2} {#3} {#4} }
{ #5 {#1} {#3} {#2} {#4} }
}
%</dvipdfmx|xdvipdfmx>
%</dvipdfmx|xetex>
% \end{macrocode}
% \end{macro}
% \end{macro}
Expand All @@ -739,21 +739,21 @@
%<*luatex|pdftex>
\@@_backend_cm:nnnn {#2} {#3} {#4} {#5}
%</luatex|pdftex>
%<*dvipdfmx|xdvipdfmx>
%<*dvipdfmx|xetex>
\__kernel_backend_literal:n
{ pdf:btrans~matrix~ #2 ~ #3 ~ #4 ~ #5 ~ 0 ~ 0 }
%</dvipdfmx|xdvipdfmx>
%</dvipdfmx|xetex>
\hbox_overlap_right:n { \box_use:N #1 }
%<*dvipdfmx|xdvipdfmx>
%<*dvipdfmx|xetex>
\__kernel_backend_literal:n { pdf:etrans }
%</dvipdfmx|xdvipdfmx>
%</dvipdfmx|xetex>
\__kernel_backend_scope_end:
}
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
%</dvipdfmx|luatex|pdftex|xdvipdfmx>
%</dvipdfmx|luatex|pdftex|xetex>
% \end{macrocode}
%
% \subsection{\texttt{dvisvgm} backend}
Expand Down
14 changes: 7 additions & 7 deletions l3backend/l3backend-graphics.dtx
Expand Up @@ -280,7 +280,7 @@
% \subsection{\texttt{dvipdfmx} backend}
%
% \begin{macrocode}
%<*dvipdfmx|xdvipdfmx>
%<*dvipdfmx|xetex>
% \end{macrocode}
%
% \begin{macro}
Expand Down Expand Up @@ -326,7 +326,7 @@
% \begin{macro}{\@@_backend_include_auxii:nnn, \@@_backend_include_auxii:xnn}
% \begin{macro}{\@@_backend_include_auxiii:nnn}
% The special syntax depends on the file type. There is a difference in
% how PDF graphics are best handled between |dvipdfmx| and |xdvipdfmx|: for
% how PDF graphics are best handled between |dvipdfmx| and \XeTeX{}: for
% the latter it is better to use the primitive route. The relevant code for
% that is included later in this file.
% \begin{macrocode}
Expand Down Expand Up @@ -425,13 +425,13 @@
% \end{macro}
%
% \begin{macrocode}
%</dvipdfmx|xdvipdfmx>
%</dvipdfmx|xetex>
% \end{macrocode}
%
% \subsection{\texttt{xdvipdfmx} backend}
% \subsection{\XeTeX{} backend}
%
% \begin{macrocode}
%<*xdvipdfmx>
%<*xetex>
% \end{macrocode}
%
% \subsubsection{Images}
Expand All @@ -448,7 +448,7 @@
% \begin{macro}{\@@_backend_getbb_auxiv:nnNnn, \@@_backend_getbb_auxiv:VnNnn}
% \begin{macro}{\@@_backend_getbb_auxv:nNnn, \@@_backend_getbb_auxv:nNnn}
% \begin{macro}[EXP]{\@@_backend_getbb_pagebox:w}
% For \texttt{xdvipdfmx}, there are two primitives that allow us to obtain
% For \XeTeX{}, there are two primitives that allow us to obtain
% the bounding box without needing \texttt{extractbb}. The only complexity
% is passing the various minor variations to a common core process. The
% \XeTeX{} primitive omits the text |box| from the page box specification,
Expand Down Expand Up @@ -536,7 +536,7 @@
% \end{macro}
%
% \begin{macrocode}
%</xdvipdfmx>
%</xetex>
% \end{macrocode}
%
% \subsection{\texttt{dvisvgm} backend}
Expand Down
8 changes: 4 additions & 4 deletions l3backend/l3backend-pdf.dtx
Expand Up @@ -1205,7 +1205,7 @@
% \subsection{\texttt{dvipdfmx} backend}
%
% \begin{macrocode}
%<*dvipdfmx|xdvipdfmx>
%<*dvipdfmx|xetex>
% \end{macrocode}
%
% \begin{macro}{\@@_backend:n, \@@_backend:x}
Expand Down Expand Up @@ -1331,7 +1331,7 @@
% \end{macro}
%
% \begin{macro}[EXP]{\@@_backend_pageobject_ref:n}
% Page references are easy in \texttt{(x)dvipdfmx}.
% Page references are easy in \texttt{dvipdfmx}/\XeTeX{}.
% \begin{macrocode}
\cs_new:Npn \@@_backend_pageobject_ref:n #1
{ @page #1 }
Expand All @@ -1341,7 +1341,7 @@
% \subsubsection{Annotations}
%
% \begin{variable}{\g_@@_landscape_bool}
% There is a bug in \texttt{(x)dvipdfmx} which means annotations do
% There is a bug in \texttt{dvipdfmx}/\XeTeX{} which means annotations do
% not rotate. As such, we need to know if landscape is active.
% \begin{macrocode}
\bool_new:N \g_@@_landscape_bool
Expand Down Expand Up @@ -1565,7 +1565,7 @@
% \end{macro}
%
% \begin{macrocode}
%</dvipdfmx|xdvipdfmx>
%</dvipdfmx|xetex>
% \end{macrocode}
%
% \subsection{\texttt{dvisvgm} backend}
Expand Down
14 changes: 7 additions & 7 deletions l3backend/l3backend.ins
Expand Up @@ -120,14 +120,14 @@ and all files in that bundle must be distributed together.
}
\generate
{
\file{l3backend-xdvipdfmx.def}
\file{l3backend-xetex.def}
{
\from{l3backend-basics.dtx} {package,xdvipdfmx}
\from{l3backend-color.dtx} {package,xdvipdfmx}
\from{l3backend-box.dtx} {package,xdvipdfmx}
\from{l3backend-draw.dtx} {package,xdvipdfmx}
\from{l3backend-graphics.dtx}{package,xdvipdfmx}
\from{l3backend-pdf.dtx} {package,xdvipdfmx}
\from{l3backend-basics.dtx} {package,xetex}
\from{l3backend-color.dtx} {package,xetex}
\from{l3backend-box.dtx} {package,xetex}
\from{l3backend-draw.dtx} {package,xetex}
\from{l3backend-graphics.dtx}{package,xetex}
\from{l3backend-pdf.dtx} {package,xetex}
}
}

Expand Down
1 change: 1 addition & 0 deletions l3kernel/CHANGELOG.md
Expand Up @@ -9,6 +9,7 @@ this project uses date-based 'snapshot' version identifiers.

### Changed
- Backend setting for direct PDF output
- Backend setting for XeTeX support

### Deprecated
- Backend setting `pdfmode`
Expand Down
7 changes: 4 additions & 3 deletions l3kernel/expl3.dtx
Expand Up @@ -926,10 +926,11 @@
% \item[dvisvgm] Use the \texttt{dvisvgm} driver.
% \item[luatex] Use the direct PDF output mode of \LuaTeX{}
% \item[pdftex] Use the direct PDF output mode of \pdfTeX{}
% \item[xdvipdfmx] Use the \texttt{xdvipdfmx} driver (\XeTeX{} only).
% \item[xetex] Use the \XeTeX{} version of the \texttt{dvipdfmx} driver.
% \end{itemize}
% For historical reasons, there is also \texttt{pdfmode} as an equivalent of
% \texttt{luatex} or \texttt{pdftex}, but this is deprecated.
% \texttt{luatex} or \texttt{pdftex}, and \texttt{xdvipdfmx} as
% an equivalent to \texttt{xetex}, but these are deprecated
%
% \DescribeOption{suppress-backend-headers}
% The \texttt{suppress-backend-headers} option suppresses loading of
Expand Down Expand Up @@ -1405,7 +1406,7 @@
\keys_define:nn { sys }
{
backend .choices:nn =
{ dvipdfmx , dvips , dvisvgm , luatex , pdftex , pdfmode , xdvipdfmx }
{ dvipdfmx , dvips , dvisvgm , luatex , pdftex , pdfmode , xdvipdfmx , xetex }
{ \sys_load_backend:n {#1} } ,
check-declarations .code:n =
{
Expand Down

0 comments on commit ccfbf74

Please sign in to comment.