[latex3-commits] [git/LaTeX3-latex3-latex3] split-pdfmode: Merge branch 'master' into split-pdfmode (b021be4c2)
Joseph Wright
joseph.wright at morningstar2.co.uk
Mon Aug 31 23:18:32 CEST 2020
Repository : https://github.com/latex3/latex3
On branch : split-pdfmode
Link : https://github.com/latex3/latex3/commit/b021be4c2509d036f9788e29f1e72726b73bb69a
>---------------------------------------------------------------
commit b021be4c2509d036f9788e29f1e72726b73bb69a
Merge: 230b31bf3 1de799d87
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Mon Aug 31 09:55:08 2020 +0100
Merge branch 'master' into split-pdfmode
>---------------------------------------------------------------
b021be4c2509d036f9788e29f1e72726b73bb69a
l3backend/CHANGELOG.md | 2 +
l3backend/l3backend-basics.dtx | 42 +-
l3backend/l3backend-color.dtx | 276 +++++-
l3backend/l3backend-header.dtx | 10 +
l3experimental/CHANGELOG.md | 3 +
l3experimental/l3color/l3color.dtx | 73 +-
.../l3color/testfiles/m3color001.xetex.tlg | 32 +-
.../l3color/testfiles/m3color003.xetex.tlg | 20 +-
l3experimental/l3draw/l3draw-transforms.dtx | 4 +
.../l3draw/testfiles/m3draw003.xetex.tlg | 116 +--
.../l3draw/testfiles/m3draw004.xetex.tlg | 92 +-
.../l3draw/testfiles/m3draw005.xetex.tlg | 12 +-
.../l3draw/testfiles/m3draw006.xetex.tlg | 56 +-
.../l3draw/testfiles/m3draw007.xetex.tlg | 20 +-
.../xcoffins/testfiles/xcoffins002.xetex.tlg | 4 +-
.../xcoffins/testfiles/xcoffins003.xetex.tlg | 16 +-
l3kernel/CHANGELOG.md | 7 +
l3kernel/doc/l3obsolete.txt | 1 +
l3kernel/expl3.dtx | 106 +--
l3kernel/l3box.dtx | 12 +-
l3kernel/l3candidates.dtx | 2 +-
l3kernel/l3color-base.dtx | 1 +
l3kernel/l3deprecation.dtx | 16 +
l3kernel/l3doc.dtx | 11 +-
l3kernel/l3expan.dtx | 11 +-
l3kernel/l3file.dtx | 135 ++-
l3kernel/l3kernel-functions.dtx | 18 +
l3kernel/l3str-convert.dtx | 316 +++----
l3kernel/l3sys.dtx | 86 +-
l3kernel/testfiles/d3dvipdfmx.tlg | 4 +-
l3kernel/testfiles/d3dvipdfmx.xetex.tlg | 4 +-
l3kernel/testfiles/d3dvips.xetex.tlg | 4 +-
l3kernel/testfiles/d3pdfmode.xetex.tlg | 4 +-
l3kernel/testfiles/d3xetex.xetex.tlg | 4 +-
l3kernel/testfiles/m3coffins001.xetex.tlg | 348 ++++----
l3kernel/testfiles/m3expl001.luatex.tlg | 4 +
l3kernel/testfiles/m3expl001.ptex.tlg | 6 +
l3kernel/testfiles/m3expl001.tlg | 4 +
l3kernel/testfiles/m3expl001.uptex.tlg | 6 +
l3kernel/testfiles/m3expl001.xetex.tlg | 7 +-
l3kernel/testfiles/m3expl003.luatex.tlg | 4 +
l3kernel/testfiles/m3expl003.ptex.tlg | 6 +
l3kernel/testfiles/m3expl003.tlg | 4 +
l3kernel/testfiles/m3expl003.uptex.tlg | 6 +
l3kernel/testfiles/m3expl003.xetex.tlg | 7 +-
l3kernel/testfiles/m3expl009.lvt | 79 --
l3kernel/testfiles/m3expl009.tlg | 27 -
l3kernel/testfiles/m3ior003.lvt | 42 +
.../testfiles/m3ior003.tlg | 12 +-
l3kernel/testfiles/m3str-convert004.tlg | 60 +-
l3kernel/testfiles/m3str-convert006.lvt | 358 ++++++++
l3kernel/testfiles/m3str-convert006.tlg | 110 +++
l3packages/xparse/xparse.dtx | 18 +-
l3trial/xbox/testfiles/xbox000.tlg | 6 +-
l3trial/xbox/testfiles/xbox001.luatex.tlg | 171 +++-
l3trial/xbox/testfiles/xbox001.lvt | 15 +-
l3trial/xbox/testfiles/xbox001.ptex.tlg | 179 +++-
l3trial/xbox/testfiles/xbox001.tlg | 169 +++-
l3trial/xbox/testfiles/xbox001.uptex.tlg | 179 +++-
l3trial/xbox/testfiles/xbox001.xetex.tlg | 253 ++++--
l3trial/xbox/testfiles/xbox002.luatex.tlg | 106 ++-
l3trial/xbox/testfiles/xbox002.lvt | 11 +-
l3trial/xbox/testfiles/xbox002.ptex.tlg | 114 ++-
l3trial/xbox/testfiles/xbox002.tlg | 106 ++-
l3trial/xbox/testfiles/xbox002.uptex.tlg | 114 ++-
l3trial/xbox/testfiles/xbox002.xetex.tlg | 162 +++-
l3trial/xbox/xbox.dtx | 955 ++++++++++++++++-----
support/texlive.sh | 2 +-
68 files changed, 3784 insertions(+), 1386 deletions(-)
diff --cc l3backend/CHANGELOG.md
index 237394cfd,a94649402..4df4b26b6
--- a/l3backend/CHANGELOG.md
+++ b/l3backend/CHANGELOG.md
@@@ -7,8 -7,8 +7,10 @@@ this project uses date-based 'snapshot
## [Unreleased]
### Changed
+ - Improved support for Separation colors
-- Updated approach to `(x)dvipdfmx` color support
++- Updated approach to `dvipdfmx`/XeTeX color support
+- Split `pdfmode` driver into pdfTeX- and LuaTeX-specific files
+- Renamed `xdvipdfmx` backend files to `xetex`
## [2020-08-07]
diff --cc l3backend/l3backend-basics.dtx
index 2c5d53af1,b80feab83..481edc0fd
--- a/l3backend/l3backend-basics.dtx
+++ b/l3backend/l3backend-basics.dtx
@@@ -81,20 -82,44 +81,48 @@@
{l3backend-dvisvgm.def}{2020-08-07}{}
{L3 backend support: dvisvgm}
%</dvisvgm>
-%<*pdfmode>
- {l3backend-pdfmode.def}{2020-08-07}{}
- {L3 backend support: PDF mode}
-%</pdfmode>
-%<*xdvipdfmx>
- {l3backend-xdvipdfmx.def}{2020-08-07}{}
- {L3 backend support: xdvipdfmx}
-%</xdvipdfmx>
+%<*luatex>
+ {l3backend-luatex.def}{2020-08-07}{}
+ {L3 backend support: PDF output (LuaTeX)}
+%</luatex>
+%<*pdftex>
+ {l3backend-pdftex.def}{2020-08-07}{}
+ {L3 backend support: PDF output (pdfTeX)}
+%</pdftex>
+%<*xetex>
+ {l3backend-xetex.def}{2020-08-07}{}
+ {L3 backend support: XeTeX}
+%</xetex>
% \end{macrocode}
%
+ % Check if the loaded kernel is at least enough to load this file.
+ % The kernel date has to be at least equal to \cs{ExplBackendFileDate}
+ % or later. If \cs{__kernel_dependency_version_check:Nn} doesn't
+ % exist we're loading in an older kernel, so it's an error anyway.
+ % With time, this test should vanish and only the dependency check
+ % should remain.
+ % \begin{macrocode}
+ \cs_if_exist:NTF \__kernel_dependency_version_check:nn
+ {
+ \__kernel_dependency_version_check:nn {2020-06-29}
+ %<dvipdfmx> {l3backend-dvipdfmx.def}
+ %<dvips> {l3backend-dvips.def}
+ %<dvisvgm> {l3backend-dvisvgm.def}
-%<pdfmode> {l3backend-pdfmode.def}
-%<xdvipdfmx> {l3backend-xdvipdfmx.def}
++%<luatex> {l3backend-luatex.def}
++%<pdftex> {l3backend-pdftex.def}
++%<xetex> {l3backend-xetex.def}
+ }
+ {
+ \cs_if_exist_use:cF { @latex at error } { \errmessage }
+ {
+ Mismatched~LaTeX~support~files~detected. \MessageBreak
+ Loading~aborted!
+ }
+ { \use:c { @ehd } }
+ \tex_endinput:D
+ }
-%</package>
+ % \end{macrocode}
+ %
% The order of the backend code here is such that we get somewhat logical
% outcomes in terms of code sharing whilst keeping things readable. (Trying to
% mix all of the code by concept is almost unmanageable.) The key parts which
diff --cc l3backend/l3backend-color.dtx
index 73ce0193b,4869caf8d..cdb86e5dc
--- a/l3backend/l3backend-color.dtx
+++ b/l3backend/l3backend-color.dtx
@@@ -60,13 -60,57 +60,57 @@@
%<@@=color>
% \end{macrocode}
%
- % Color support is split into two parts: a \enquote{general} concept and
- % 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{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.
+ % Color support is split into parts: general color, separations, and color for
+ % drawings. We have different approaches in each backend, and have some choices
-% to make about \texttt{(x)dvipdfmx} in particular. Whilst it is in some ways
++% to make about \texttt{dvipdfmx}/\XeTeX{} in particular. Whilst it is in some ways
+ % convenient to use the same approach in multiple backends, the fact that
-% \texttt{(x)dvipdfmx} is PDF-based means it (largely) sticks closer to
++% \texttt{dvipdfmx}/\XeTeX{} is PDF-based means it (largely) sticks closer to
+ % direct PDF output.
+ %
-% \subsection{\texttt{(x)dvipmdfx}}
++% \subsection{\texttt{dvipmdfx}/\XeTeX{}}
+ %
+ % \begin{macrocode}
-%<*dvipdfmx|xdvipdfmx>
++%<*dvipdfmx|xetex>
+ % \end{macrocode}
+ %
-% This backend has the most possible approaches: it recognises both
++% These backends have the most possible approaches: it recognises both
+ % \texttt{dvips}-based color specials and it's own format, plus one can
+ % include PDF statements directly. The latter are not subject to the stack,
+ % so are not suitable for general use. Of the two stack methods, the dedicated
+ % one has been extended to cover color spaces, so it is used in preference to
+ % the \texttt{dvips} one.
+ %
+ % The \LaTeXe{} backend code uses \texttt{dvips}-based code with
-% \texttt{(x)dvipdfmx}, and so we leave getting color from \LaTeXe{} to
++% \texttt{dvipmdfx}/\XeTeX{}, and so we leave getting color from \LaTeXe{} to
+ % a shared code path below.
+ %
+ % \begin{macro}
+ % {
+ % \@@_backend_select_cmyk:n ,
+ % \@@_backend_select_gray:n ,
+ % \@@_backend_select_rgb:n
+ % }
+ % \begin{macro}{\@@_backend_reset:}
+ % \begin{macro}{color.sc, color.fc}
+ % Push the data to the stack.
+ % \begin{macrocode}
+ \cs_new_protected:Npn \@@_backend_select_cmyk:n #1
+ {
+ \__kernel_backend_literal:n { pdf: bc ~ [#1] }
+ \group_insert_after:N \@@_backend_reset:
+ }
+ \cs_new_eq:NN \@@_backend_select_gray:n \@@_backend_select_cmyk:n
+ \cs_new_eq:NN \@@_backend_select_rgb:n \@@_backend_select_cmyk:n
+ \cs_new_protected:Npn \@@_backend_reset:
+ { \__kernel_backend_literal:n { pdf: ec } }
+ % \end{macrocode}
+ % \end{macro}
+ % \end{macro}
+ % \end{macro}
+ %
+ % \begin{macrocode}
-%</dvipdfmx|xdvipdfmx>
++%</dvipdfmx|xetex>
+ % \end{macrocode}
%
% \subsection{\texttt{dvips}-style}
%
@@@ -106,6 -150,14 +150,14 @@@
% \end{macro}
% \end{macro}
%
+ % \begin{macrocode}
-%</dvisvgm|dvipdfmx|dvips|xdvipdfmx>
++%</dvisvgm|dvipdfmx|dvips|xetex>
+ % \end{macrocode}
+ %
+ % \begin{macrocode}
+ %<*dvisvgm|dvips>
+ % \end{macrocode}
+ %
% \begin{macro}
% {
% \@@_backend_select_cmyk:n ,
@@@ -140,21 -192,14 +192,14 @@@
% \end{macro}
% \end{macro}
%
- % \begin{macro}{\@@_backend_select_separation:nn}
% \begin{macrocode}
- \cs_new_protected:Npn \@@_backend_select_separation:nn #1#2
- { \@@_backend_select:n {#1} }
- % \end{macrocode}
- % \end{macro}
- %
- % \begin{macrocode}
- %</dvisvgm|dvipdfmx|dvips|xetex>
+ %</dvisvgm|dvips>
% \end{macrocode}
%
-% \subsection{\texttt{pdfmode}}
+% \subsection{\LuaTeX{} and \pdfTeX{}}
%
% \begin{macrocode}
-%<*pdfmode>
+%<*luatex|pdftex>
% \end{macrocode}
%
% \begin{macro}{\@@_backend_pickup:N}
@@@ -250,15 -289,216 +295,216 @@@
% \end{macro}
% \end{macro}
%
+ % \begin{macrocode}
-%</pdfmode>
++%</luatex|pdftex>
+ % \end{macrocode}
+ %
+ % \subsection{Separations}
+ %
+ % Here, life gets interesting and we need essentially one approach per
+ % backend.
+ %
+ % \begin{macrocode}
+ %<*dvips>
+ % \end{macrocode}
+ %
% \begin{macro}{\@@_backend_select_separation:nn}
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_select_separation:nn #1#2
+ { \@@_backend_select:n { setspotcolor ~ #1 ~ #2 } }
+ % \end{macrocode}
+ % \end{macro}
+ %
+ % \begin{macro}{\@@_backend_separation_init:nnnnn}
+ % \begin{macro}{\@@_backend_separation_init:nnn}
+ % \begin{macro}[EXP]{\@@_backend_separation_init:n}
+ % \begin{macro}[EXP]{\@@_backend_separation_init:w}
+ % \begin{macro}{\@@_backend_separation_init_cielab:nnnnn}
+ % \begin{macro}{\@@_backend_separation_init_cielab:n}
+ % Initialising here means creating a small header set up plus massaging
+ % some data. This comes about as we have to deal with PDF-focussed data,
+ % which makes most sense \enquote{higher-up}. The approach is based on
+ % ideas from \url{https://tex.stackexchange.com/q/560093}.
+ % \begin{macrocode}
+ \cs_new_protected:Npx \@@_backend_separation_init:nnnnn #1#2#3#4#5
+ {
+ \bool_if:NT \g__kernel_backend_header_bool
+ {
+ \cs_if_exist:NTF \AtBeginDvi
+ { \AtBeginDvi }
+ { \use:n }
+ {
+ \exp_not:N \@@_backend_separation_init:nnn
+ {#1} {#2} {#5}
+ }
+ }
+ }
+ \cs_new_protected:Npn \@@_backend_separation_init:nnn #1#2#3
+ {
+ \__kernel_backend_literal:e
+ {
+ !
+ TeXDict ~ begin ~
+ /color \int_use:N \g_@@_separation_int \c_space_tl
+ [#3] ~ aload ~ pop ~ ( \str_convert_pdfname:n {#1} ) ~
+ find \@@_backend_separation_init:n {#2} customcolor ~ def ~
+ end
+ }
+ }
+ \cs_new:Npn \@@_backend_separation_init:n #1
+ {
+ \@@_backend_separation_init:w #1 /Device #1 /Device \s_@@_stop
+ }
+ \cs_new:Npn \@@_backend_separation_init:w #1 /Device #2 /Device #3 \s_@@_stop
+ { \str_lowercase:n {#2} }
+ % \end{macrocode}
+ % Currently no CIELAB support.
+ % \begin{macrocode}
+ \cs_new_protected:Npn \@@_backend_separation_init_cielab:nnnnn #1#2#3#4#5 { }
+ \cs_new_protected:Npn \@@_backend_separation_init_cielab:n #1 { }
+ % \end{macrocode}
+ % \end{macro}
+ % \end{macro}
+ % \end{macro}
+ % \end{macro}
+ % \end{macro}
+ % \end{macro}
+ %
+ % \begin{macrocode}
+ %</dvips>
+ % \end{macrocode}
+ %
+ % \begin{macrocode}
+ %<*dvisvgm>
+ % \end{macrocode}
+ %
+ % \begin{macro}{\@@_backend_select_separation:nn}
+ % No support at present.
+ % \begin{macrocode}
+ \cs_new_protected:Npn \@@_backend_select_separation:nn #1#2 { }
+ % \end{macrocode}
+ % \end{macro}
+ %
+ % \begin{macro}
+ % {\@@_backend_separation_init:nnnnn, \@@_backend_separation_init_cielab:nnnnn}
+ % \begin{macro}{\@@_backend_separation_init_cielab:n}
+ % No support at present.
+ % \begin{macrocode}
+ \cs_new_protected:Npn \@@_backend_separation_init:nnnnn #1#2#3#4#5 { }
+ \cs_new_protected:Npn \@@_backend_separation_init_cielab:nnnnn #1#2#3#4#5 { }
+ \cs_new_protected:Npn \@@_backend_separation_init_cielab:n #1 { }
+ % \end{macrocode}
+ % \end{macro}
+ % \end{macro}
+ %
+ % \begin{macrocode}
+ %</dvisvgm>
+ % \end{macrocode}
+ %
+ % \begin{macrocode}
-%<*dvipdfmx|pdfmode|xdvipdfmx>
++%<*dvipdfmx|luatex|pdftex|xetex>
+ % \end{macrocode}
+ %
+ % \begin{macro}{\@@_backend_select_separation:nn}
+ % Different syntaxes here as the stacks are accessed very differently.
+ % \begin{macrocode}
+ \cs_new_protected:Npn \@@_backend_select_separation:nn #1#2
-%<*dvipdfmx|xdvipdfmx>
++%<*dvipdfmx|xetex>
+ { \@@_backend_select:n { @#1 ~ [#2] } }
-%</dvipdfmx|xdvipdfmx>
-%<*pdfmode>
++%</dvipdfmx|xetex>
++%<*luatex|pdftex>
{ \@@_backend_select:n { /#1 ~ cs ~ /#1 ~ CS ~ #2 ~ scn ~ #2 ~ SCN } }
-%</pdfmode>
++%</luatex|pdftex>
% \end{macrocode}
% \end{macro}
%
+ % \begin{macro}{\@@_backend_separation_init:nnnnn}
+ % \begin{macro}{\@@_backend_separation_init:n}
+ % \begin{macro}{\@@_backend_separation_init_cielab:nnnnn}
+ % \begin{macro}{\@@_backend_separation_init_cielab:n}
+ % Initialising the PDF structures needs two parts: creating an object
+ % containing the \enquote{real} name of the Separation, then adding a reference
+ % to that to each page. The latter uses the internal name of the \texttt{cs}.
-% For \texttt{(x)dvipdfmx}, the backend does most of the work so we need a
++% For \texttt{dvipdfmx}/\XeTeX{}, the backend does most of the work so we need a
+ % simplified version.
% \begin{macrocode}
+ \cs_new_protected:Npn \@@_backend_separation_init:nnnnn #1#2#3#4#5
+ {
+ \@@_backend_separation_init:n
+ {
+ /Separation
+ / \str_convert_pdfname:n {#1} ~ #2 ~
+ <<
+ /FunctionType ~ 2
+ /Domain ~ [0 ~ 1]
+ \tl_if_blank:nF {#3} { /Range ~ [#3] }
+ /C0 ~ [#4] ~
+ /C1 ~ [#5] /N ~ 1
+ >>
+ }
-%<*pdfmode>
++%<*luatex|pdftex>
+ \use:x
+ {
+ \pdfcoredict_gput:nnn
+ { Page / Resources / ColorSpace }
+ { color \int_use:N \g_@@_separation_int }
+ { \pdf_object_last: }
+ }
-%</pdfmode>
+%</luatex|pdftex>
+ }
+ \cs_if_exist:NF \pdf_object_now:nn
+ { \cs_gset_protected:Npn \@@_backend_separation_init:nnnnn #1#2#3#4#5 { } }
+ \cs_new_protected:Npn \@@_backend_separation_init:n #1
+ {
-%<*dvipdfmx|xdvipdfmx>
++%<*dvipdfmx|xetex>
+ \__kernel_backend_literal:x
+ {
+ pdf:obj ~ @ color \int_use:N \g_@@_separation_int \c_space_tl
+ [#1]
+ }
-%</dvipdfmx|xdvipdfmx>
-%<*pdfmode>
++%</dvipdfmx|xetex>
++%<*luatex|pdftex>
+ \pdf_object_now:nx { array } {#1}
-%</pdfmode>
++%</luatex|pdftex>
+ }
+ % \end{macrocode}
+ % For CIELAB colors, we need one object per document for the illuminant,
+ % plus initialisation of the color space referencing that object.
+ % \begin{macrocode}
+ \cs_new_protected:Npn \@@_backend_separation_init_cielab:nnnnn #1#2#3#4#5
+ {
+ \@@_backend_separation_init:nnnnn
+ {#2}
+ { \pdf_object_ref:n { @@_illuminant_cielab_ #1 } }
+ { \c_@@_model_range_lab_tl }
+ { 100 ~ 0 ~ 0 }
+ { #3 ~ #4 ~ #5 }
+ }
+ \cs_if_exist:NF \pdf_object_now:nn
+ { \cs_gset_protected:Npn \@@_backend_separation_init_cielab:nnnnn #1#2#3#4#5 { } }
+ \cs_new_protected:Npn \@@_backend_separation_init_cielab:n #1
+ {
+ \pdf_object_new:nn { @@_illuminant_cielab_ #1 } { array }
+ \pdf_object_write:nx { @@_illuminant_cielab_ #1 }
+ {
+ /Lab ~
+ <<
+ /WhitePoint ~
+ [ \tl_use:c { c_@@_model_whitepoint_cielab_ #1 _tl } ]
+ /Range ~ [ \c_@@_model_range_lab_tl ]
+ >>
+ }
+ }
+ \cs_if_exist:NF \pdf_object_new:nn
+ { \cs_gset_protected:Npn \@@_backend_separation_init_cielab:n #1 { } }
+ % \end{macrocode}
+ % \end{macro}
+ % \end{macro}
+ % \end{macro}
+ % \end{macro}
+ %
+ % \begin{macrocode}
-%</dvipdfmx|pdfmode|xdvipdfmx>
++%</dvipdfmx|luatex|pdftex|xetex>
% \end{macrocode}
%
% \subsection{Fill and stroke color}
diff --cc l3kernel/CHANGELOG.md
index e89da07c1,709635486..0c84ed35f
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@@ -7,13 -7,9 +7,16 @@@ this project uses date-based 'snapshot
## [Unreleased]
+ ### Added
+ - `\hbox_overlap_center:n`
+
+### Changed
+- Backend setting for direct PDF output
+- Backend setting for XeTeX support
+
+### Deprecated
+- Backend setting `pdfmode`
+
### Fixed
- `\file_compare_timestamp:nNn(TF)` in LuaTeX (issue #792)
More information about the latex3-commits
mailing list.