summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3backend
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-04-12 03:04:20 +0000
committerNorbert Preining <norbert@preining.info>2022-04-12 03:04:20 +0000
commitf713ac513a897193c8b6ac8e34d55d8490fe270f (patch)
tree9d3e92c83b32b83f2c473fdab5c7b1c74ae6a2cc /macros/latex/contrib/l3backend
parenta04c4e735928bbfb74963fc19ea3fe8b0e1b7031 (diff)
CTAN sync 202204120304
Diffstat (limited to 'macros/latex/contrib/l3backend')
-rw-r--r--macros/latex/contrib/l3backend/CHANGELOG.md16
-rw-r--r--macros/latex/contrib/l3backend/README.md2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-basics.dtx43
-rw-r--r--macros/latex/contrib/l3backend/l3backend-box.dtx2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-code.pdfbin896928 -> 896719 bytes
-rw-r--r--macros/latex/contrib/l3backend/l3backend-color.dtx205
-rw-r--r--macros/latex/contrib/l3backend/l3backend-draw.dtx2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-graphics.dtx412
-rw-r--r--macros/latex/contrib/l3backend/l3backend-header.dtx2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-opacity.dtx45
-rw-r--r--macros/latex/contrib/l3backend/l3backend-pdf.dtx26
11 files changed, 373 insertions, 382 deletions
diff --git a/macros/latex/contrib/l3backend/CHANGELOG.md b/macros/latex/contrib/l3backend/CHANGELOG.md
index 68a0f8e377..e94dbb881d 100644
--- a/macros/latex/contrib/l3backend/CHANGELOG.md
+++ b/macros/latex/contrib/l3backend/CHANGELOG.md
@@ -6,6 +6,19 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+## [2022-04-10]
+
+### Added
+- Support for graphics (PDF) page count extraction
+
+### Fixed
+- Setup for graphics extension searching
+- Various internal issues in graphics inclusion
+- Some missing functions for `dvisvgm` color support added
+
+### Removed
+- Support for pre-2020-11-11 `dvipdfmx`
+
## [2022-02-07]
### Fixed
@@ -217,7 +230,8 @@ this project uses date-based 'snapshot' version identifiers.
- Include `l3backend` in file names
- Moved backend code to internal for each 'parent' module
-[Unreleased]: https://github.com/latex3/latex3/compare/2022-02-07...HEAD
+[Unreleased]: https://github.com/latex3/latex3/compare/2022-04-10...HEAD
+[2022-04-10]: https://github.com/latex3/latex3/compare/2022-02-07...2022-04-10
[2022-02-07]: https://github.com/latex3/latex3/compare/2022-01-12...2022-02-07
[2022-01-12]: https://github.com/latex3/latex3/compare/2021-12-14...2022-01-12
[2021-12-14]: https://github.com/latex3/latex3/compare/2021-10-17...2021-12-14
diff --git a/macros/latex/contrib/l3backend/README.md b/macros/latex/contrib/l3backend/README.md
index 31dccaaa60..470d6914a0 100644
--- a/macros/latex/contrib/l3backend/README.md
+++ b/macros/latex/contrib/l3backend/README.md
@@ -1,7 +1,7 @@
LaTeX3 Backend Drivers
======================
-Release 2022-02-07
+Release 2022-04-10
This package forms parts of `expl3`, and contains the code used to interface
with backends (drivers) across the `expl3` codebase. The functions here are
diff --git a/macros/latex/contrib/l3backend/l3backend-basics.dtx b/macros/latex/contrib/l3backend/l3backend-basics.dtx
index d7c3c6e4c3..f4bf61fe70 100644
--- a/macros/latex/contrib/l3backend/l3backend-basics.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-basics.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2022-02-07}
+% \date{Released 2022-04-10}
%
% \maketitle
%
@@ -70,27 +70,27 @@
% \begin{macrocode}
\ProvidesExplFile
%<*dvipdfmx>
- {l3backend-dvipdfmx.def}{2022-02-07}{}
+ {l3backend-dvipdfmx.def}{2022-04-10}{}
{L3 backend support: dvipdfmx}
%</dvipdfmx>
%<*dvips>
- {l3backend-dvips.def}{2022-02-07}{}
+ {l3backend-dvips.def}{2022-04-10}{}
{L3 backend support: dvips}
%</dvips>
%<*dvisvgm>
- {l3backend-dvisvgm.def}{2022-02-07}{}
+ {l3backend-dvisvgm.def}{2022-04-10}{}
{L3 backend support: dvisvgm}
%</dvisvgm>
%<*luatex>
- {l3backend-luatex.def}{2022-02-07}{}
+ {l3backend-luatex.def}{2022-04-10}{}
{L3 backend support: PDF output (LuaTeX)}
%</luatex>
%<*pdftex>
- {l3backend-pdftex.def}{2022-02-07}{}
+ {l3backend-pdftex.def}{2022-04-10}{}
{L3 backend support: PDF output (pdfTeX)}
%</pdftex>
%<*xetex>
- {l3backend-xetex.def}{2022-02-07}{}
+ {l3backend-xetex.def}{2022-04-10}{}
{L3 backend support: XeTeX}
%</xetex>
% \end{macrocode}
@@ -395,35 +395,6 @@
% \end{macro}
%
% \begin{macrocode}
-%<@@=sys>
-% \end{macrocode}
-%
-% \begin{macro}{\c__kernel_sys_dvipdfmx_version_int}
-% A short excursion into the |sys| module to set up the backend version
-% information.
-% \begin{macrocode}
-\group_begin:
- \cs_set:Npn \@@_tmp:w #1 Version ~ #2 ~ #3 \q_stop {#2}
- \sys_get_shell:nnNTF { extractbb~--version }
- { \char_set_catcode_space:n { `\ } }
- \l_@@_internal_tl
- {
- \int_const:Nn \c__kernel_sys_dvipdfmx_version_int
- {
- \exp_after:wN \@@_tmp:w \l_@@_internal_tl
- \q_stop
- }
- }
- { \int_const:Nn \c__kernel_sys_dvipdfmx_version_int { 0 } }
-\group_end:
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macrocode}
-%<@@=>
-% \end{macrocode}
-%
-% \begin{macrocode}
%</dvipdfmx|xetex>
% \end{macrocode}
%
diff --git a/macros/latex/contrib/l3backend/l3backend-box.dtx b/macros/latex/contrib/l3backend/l3backend-box.dtx
index 1d3450c78c..a732d60564 100644
--- a/macros/latex/contrib/l3backend/l3backend-box.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-box.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2022-02-07}
+% \date{Released 2022-04-10}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3backend/l3backend-code.pdf b/macros/latex/contrib/l3backend/l3backend-code.pdf
index a3f052df2c..960a45053c 100644
--- a/macros/latex/contrib/l3backend/l3backend-code.pdf
+++ b/macros/latex/contrib/l3backend/l3backend-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3backend/l3backend-color.dtx b/macros/latex/contrib/l3backend/l3backend-color.dtx
index 064c55fa60..815b41302a 100644
--- a/macros/latex/contrib/l3backend/l3backend-color.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-color.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2022-02-07}
+% \date{Released 2022-04-10}
%
% \maketitle
%
@@ -203,54 +203,50 @@
% In \texttt{(x)dvipdfmx}, the base color stack is not set up, so we have to
% force that, as well as providing a mechanism more generally.
% \begin{macrocode}
-\int_compare:nNnTF \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
- { \cs_new_protected:Npn \__kernel_color_backend_stack_init:Nnn #1#2#3 { } }
+\int_new:N \g_@@_backend_stack_int
+\cs_new_protected:Npx \__kernel_color_backend_stack_init:Nnn #1#2#3
{
- \int_new:N \g_@@_backend_stack_int
- \cs_new_protected:Npx \__kernel_color_backend_stack_init:Nnn #1#2#3
+ \int_gincr:N \exp_not:N \g_@@_backend_stack_int
+ \int_const:Nn #1 { \exp_not:N \g_@@_backend_stack_int }
+ \use:x
{
- \int_gincr:N \exp_not:N \g_@@_backend_stack_int
- \int_const:Nn #1 { \exp_not:N \g_@@_backend_stack_int }
- \use:x
+ \__kernel_backend_first_shipout:n
{
- \__kernel_backend_first_shipout:n
+ \__kernel_backend_literal:n
{
- \__kernel_backend_literal:n
- {
- pdfcolorstackinit ~
- \exp_not:N \int_use:N \exp_not:N \g_@@_backend_stack_int
- \c_space_tl
- \exp_not:N \tl_if_blank:nF {#2} { #2 ~ }
- (#3)
- }
+ pdfcolorstackinit ~
+ \exp_not:N \int_use:N \exp_not:N \g_@@_backend_stack_int
+ \c_space_tl
+ \exp_not:N \tl_if_blank:nF {#2} { #2 ~ }
+ (#3)
}
- }
- }
- \cs_if_exist:cTF { main@pdfcolorstack }
- {
- \int_set:Nn \l_@@_backend_stack_int
- { \int_use:c { main@pdfcolorstack } }
- }
- {
- \__kernel_color_backend_stack_init:Nnn \c_@@_backend_main_stack_int
- { page ~ direct } { 0 ~ g ~ 0 ~ G }
- \int_set_eq:NN \l_@@_backend_stack_int
- \c_@@_backend_main_stack_int
- \int_const:cn { main@pdfcolorstack } { \c_@@_backend_main_stack_int }
+ }
}
+ }
+\cs_if_exist:cTF { main@pdfcolorstack }
+ {
+ \int_set:Nn \l_@@_backend_stack_int
+ { \int_use:c { main@pdfcolorstack } }
+ }
+ {
+ \__kernel_color_backend_stack_init:Nnn \c_@@_backend_main_stack_int
+ { page ~ direct } { 0 ~ g ~ 0 ~ G }
+ \int_set_eq:NN \l_@@_backend_stack_int
+ \c_@@_backend_main_stack_int
+ \int_const:cn { main@pdfcolorstack } { \c_@@_backend_main_stack_int }
+ }
% \end{macrocode}
% The backend automatically restores the stack color from the \enquote{classical}
% approach (\texttt{pdf:bcolor}) after a scope. That will be an issue for us, so
% we manually ensure that the one we are using is inserted.
% \begin{macrocode}
- \cs_gset_protected:Npn \__kernel_backend_scope_end:
+\cs_gset_protected:Npn \__kernel_backend_scope_end:
+ {
+ \__kernel_backend_literal:n { x:grestore }
+ \__kernel_backend_literal:x
{
- \__kernel_backend_literal:n { x:grestore }
- \__kernel_backend_literal:x
- {
- pdfcolorstack ~
- \int_use:N \g_@@_backend_stack_int \c_space_tl current
- }
+ pdfcolorstack ~
+ \int_use:N \g_@@_backend_stack_int \c_space_tl current
}
}
% \end{macrocode}
@@ -261,26 +257,23 @@
% \begin{macro}{\__kernel_color_backend_stack_pop:n}
% Simple enough but needs a version check.
% \begin{macrocode}
-\int_compare:nNnF \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
+\cs_new_protected:Npn \__kernel_color_backend_stack_push:nn #1#2
{
- \cs_new_protected:Npn \__kernel_color_backend_stack_push:nn #1#2
+ \__kernel_backend_literal:x
{
- \__kernel_backend_literal:x
- {
- pdfcolorstack ~
- \int_eval:n {#1} ~
- push ~ (#2)
- }
+ pdfcolorstack ~
+ \int_eval:n {#1} ~
+ push ~ (#2)
}
- \cs_generate_variant:Nn \__kernel_color_backend_stack_push:nn { nx }
- \cs_new_protected:Npn \__kernel_color_backend_stack_pop:n #1
+ }
+\cs_generate_variant:Nn \__kernel_color_backend_stack_push:nn { nx }
+\cs_new_protected:Npn \__kernel_color_backend_stack_pop:n #1
+ {
+ \__kernel_backend_literal:x
{
- \__kernel_backend_literal:x
- {
- pdfcolorstack ~
- \int_eval:n {#1} ~
- pop
- }
+ pdfcolorstack ~
+ \int_eval:n {#1} ~
+ pop
}
}
% \end{macrocode}
@@ -440,10 +433,6 @@
%
% \subsubsection{\texttt{dvipmdfx}/\XeTeX{}}
%
-% \begin{macrocode}
-%<*dvipdfmx|xetex>
-% \end{macrocode}
-%
% 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. Recent releases also have a color stack
@@ -452,32 +441,6 @@
% we have. Thus it is used in preference to the \texttt{dvips}-style interface
% or the \enquote{native} color specials (which have only one stack).
%
-% \begin{macro}
-% {
-% \@@_backend_select_cmyk:n ,
-% \@@_backend_select_gray:n ,
-% \@@_backend_select_rgb:n
-% }
-% \begin{macro}{\@@_backend_reset:}
-% Push the data to the stack.
-% \begin{macrocode}
-\int_compare:nNnT \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
- {
- \cs_gset_protected:Npn \@@_backend_select_cmyk:n #1
- { \__kernel_backend_literal:n { pdf: bc ~ [#1] } }
- \cs_gset_eq:NN \@@_backend_select_gray:n \@@_backend_select_cmyk:n
- \cs_gset_eq:NN \@@_backend_select_rgb:n \@@_backend_select_cmyk:n
- \cs_gset_protected:Npn \@@_backend_reset:
- { \__kernel_backend_literal:n { pdf: ec } }
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macrocode}
-%</dvipdfmx|xetex>
-% \end{macrocode}
-%
% \subsection{Separations}
%
% Here, life gets interesting and we need essentially one approach per
@@ -1097,28 +1060,6 @@
%</dvipdfmx|luatex|pdftex|xetex>
% \end{macrocode}
%
-% \begin{macrocode}
-%<*dvipdfmx|xetex>
-% \end{macrocode}
-%
-% \begin{macro}{\@@_backend_select_separation:nn, \@@_backend_select_devicen:nn}
-% For older \texttt{(x)dvipdfmx}, we \emph{could} support separations using a
-% dedicated mechanism, but it was not added that long before the color
-% stacks. So instead of having two complex paths, just disable here.
-% \begin{macrocode}
-\int_compare:nNnT \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
- {
- \cs_gset_protected:Npn \@@_backend_select_separation:nn #1#2 { }
- \cs_gset_eq:NN \@@_backend_select_devicen:nn
- \@@_backend_select_separation:nn
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macrocode}
-%</dvipdfmx|xetex>
-% \end{macrocode}
-%
% \subsection{Fill and stroke color}
%
% Here, \texttt{dvipdfmx}/\XeTeX{} follows \LuaTeX{} and \pdfTeX{},
@@ -1198,52 +1139,6 @@
% \end{macrocode}
%
% \begin{macrocode}
-%<*dvipdfmx|xetex>
-% \end{macrocode}
-%
-% \begin{macro}
-% {
-% \@@_backend_fill_cmyk:n ,
-% \@@_backend_fill_gray:n ,
-% \@@_backend_fill_rgb:n
-% }
-% \begin{macro}{\@@_backend_reset:}
-% \begin{macro}{\@@_backend_stroke:n}
-% \begin{macro}{\@@_backend_fill_separation:nn, \@@_backend_stroke_separation:nn}
-% Deal with older \texttt{(x)dvipdfmx}.
-% \begin{macrocode}
-\int_compare:nNnT \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
- {
- \cs_gset_protected:Npn \@@_backend_fill_cmyk:n #1
- {
- \__kernel_backend_literal:n { pdf: bc ~ [#1] }
- \group_insert_after:N \@@_backend_reset:
- }
- \cs_gset_eq:NN \@@_backend_fill_gray:n \@@_backend_fill_cmyk:n
- \cs_gset_eq:NN \@@_backend_fill_rgb:n \@@_backend_fill_cmyk:n
- \cs_gset_protected:Npn \@@_backend_reset:
- { \__kernel_backend_literal:n { pdf: ec } }
- \cs_gset_protected:Npn \@@_backend_stroke:n #1
- { \__kernel_backend_literal:n {#1} }
- \cs_gset_protected:Npn \@@_backend_fill_separation:nn #1#2 { }
- \cs_gset_eq:NN \@@_backend_fill_devicen:nn
- \@@_backend_fill_separation:nn
- \cs_gset_eq:NN \@@_backend_stroke_separation:nn
- \@@_backend_fill_separation:nn
- \cs_gset_eq:NN \@@_backend_stroke_devicen:nn
- \@@_backend_stroke_separation:nn
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macrocode}
-%</dvipdfmx|xetex>
-% \end{macrocode}
-%
-% \begin{macrocode}
%<*dvips>
% \end{macrocode}
%
@@ -1414,6 +1309,14 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@@_backend_devicen_init:nnn, \@@_backend_iccbased_init:nnn}
+% No support at present.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_backend_devicen_init:nnn #1#2#3 { }
+\cs_new_protected:Npn \@@_backend_iccbased_init:nnn #1#2#3 { }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
%</dvisvgm>
% \end{macrocode}
diff --git a/macros/latex/contrib/l3backend/l3backend-draw.dtx b/macros/latex/contrib/l3backend/l3backend-draw.dtx
index 43da62e394..0f9fcb6008 100644
--- a/macros/latex/contrib/l3backend/l3backend-draw.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-draw.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2022-02-07}
+% \date{Released 2022-04-10}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3backend/l3backend-graphics.dtx b/macros/latex/contrib/l3backend/l3backend-graphics.dtx
index 37122b9a74..1bd6a7e336 100644
--- a/macros/latex/contrib/l3backend/l3backend-graphics.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-graphics.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2022-02-07}
+% \date{Released 2022-04-10}
%
% \maketitle
%
@@ -60,20 +60,48 @@
%<@@=graphics>
% \end{macrocode}
%
+% \begin{macro}{\@@_backend_loaded:n}
+% To deal with file load ordering. Plain users are on their own.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_backend_loaded:n #1
+ {
+ \cs_if_exist:NTF \hook_gput_code:nnn
+ {
+ \hook_gput_code:nnn
+ { file / l3graphics.sty / after }
+ { backend }
+ {#1}
+ }
+ {#1}
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{\texttt{dvips} backend}
%
% \begin{macrocode}
%<*dvips>
% \end{macrocode}
%
-% \begin{macro}{\@@_backend_getbb_eps:n}
+% \begin{variable}{\l_graphics_search_ext_seq}
+% \begin{macrocode}
+\@@_backend_loaded:n
+ { \seq_set_from_clist:Nn \l_graphics_search_ext_seq { .eps , .ps } }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\@@_backend_getbb_eps:n, \@@_backend_getbb_ps:n}
% Simply use the generic function.
% \begin{macrocode}
-\cs_new_eq:NN \@@_backend_getbb_eps:n \graphics_read_bb:n
+\@@_backend_loaded:n
+ {
+ \cs_new_eq:NN \@@_backend_getbb_eps:n \@@_read_bb:n
+ \cs_new_eq:NN \@@_backend_getbb_ps:n \@@_read_bb:n
+ }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_backend_include_eps:n}
+% \begin{macro}{\@@_backend_include_eps:n, \@@_backend_include_ps:n}
% The special syntax is relatively clear here: remember we need PostScript
% sizes here.
% \begin{macrocode}
@@ -82,12 +110,20 @@
\__kernel_backend_literal:x
{
PSfile = #1 \c_space_tl
- llx = \dim_to_decimal_in_bp:n \l_graphics_llx_dim \c_space_tl
- lly = \dim_to_decimal_in_bp:n \l_graphics_lly_dim \c_space_tl
- urx = \dim_to_decimal_in_bp:n \l_graphics_urx_dim \c_space_tl
- ury = \dim_to_decimal_in_bp:n \l_graphics_ury_dim
+ llx = \dim_to_decimal_in_bp:n \l_@@_llx_dim \c_space_tl
+ lly = \dim_to_decimal_in_bp:n \l_@@_lly_dim \c_space_tl
+ urx = \dim_to_decimal_in_bp:n \l_@@_urx_dim \c_space_tl
+ ury = \dim_to_decimal_in_bp:n \l_@@_ury_dim
}
}
+\cs_new_eq:NN \@@_backend_include_ps:n \@@_backend_include_eps:n
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_backend_get_pagecount:n}
+% \begin{macrocode}
+\@@_backend_loaded:n
+ { \cs_new_eq:NN \@@_backend_get_pagecount:n \@@_get_pagecount:n }
% \end{macrocode}
% \end{macro}
%
@@ -101,6 +137,17 @@
%<*luatex|pdftex>
% \end{macrocode}
%
+% \begin{variable}{\l_graphics_search_ext_seq}
+% \begin{macrocode}
+\@@_backend_loaded:n
+ {
+ \seq_set_from_clist:Nn
+ \l_graphics_search_ext_seq
+ { .pdf , .eps , .png , .jpg , .jpeg }
+ }
+% \end{macrocode}
+% \end{variable}
+%
% \begin{variable}{\l_@@_graphics_attr_tl}
% In PDF mode, additional attributes of an graphic (such as page number) are
% needed both to obtain the bounding box and when inserting the graphic: this
@@ -115,12 +162,18 @@
%
% \begin{macro}
% {
-% \@@_backend_getbb_jpg:n,
-% \@@_backend_getbb_pdf:n,
+% \@@_backend_getbb_jpg:n ,
+% \@@_backend_getbb_jpeg:n ,
+% \@@_backend_getbb_pdf:n ,
% \@@_backend_getbb_png:n
% }
% \begin{macro}
-% {\@@_backend_getbb_auxi:n, \@@_backend_getbb_auxii:n}
+% {
+% \@@_backend_getbb_auxi:n ,
+% \@@_backend_getbb_auxii:n ,
+% \@@_backend_getbb_auxiii:n
+% }
+% \begin{macro}[EXP]{\@@_backend_dequote:w}
% Getting the bounding box here requires us to box up the graphic and
% measure it. To deal with the difference in feature support in bitmap
% and vector graphics but keeping the common parts, there is a little work
@@ -130,78 +183,88 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_getbb_jpg:n #1
{
- \int_zero:N \l_graphics_page_int
- \tl_clear:N \l_graphics_pagebox_tl
+ \int_zero:N \l_@@_page_int
+ \tl_clear:N \l_@@_pagebox_tl
\tl_set:Nx \l_@@_graphics_attr_tl
{
- \tl_if_empty:NF \l_graphics_decodearray_tl
- { :D \l_graphics_decodearray_tl }
- \bool_if:NT \l_graphics_interpolate_bool
+ \tl_if_empty:NF \l_@@_decodearray_str
+ { :D \l_@@_decodearray_str }
+ \bool_if:NT \l_@@_interpolate_bool
{ :I }
}
\tl_clear:N \l_@@_graphics_attr_tl
\@@_backend_getbb_auxi:n {#1}
}
+\cs_new_eq:NN \@@_backend_getbb_jpeg:n \@@_backend_getbb_jpg:n
\cs_new_eq:NN \@@_backend_getbb_png:n \@@_backend_getbb_jpg:n
\cs_new_protected:Npn \@@_backend_getbb_pdf:n #1
{
- \tl_clear:N \l_graphics_decodearray_tl
- \bool_set_false:N \l_graphics_interpolate_bool
+ \tl_clear:N \l_@@_decodearray_str
+ \bool_set_false:N \l_@@_interpolate_bool
\tl_set:Nx \l_@@_graphics_attr_tl
{
- : \l_graphics_pagebox_tl
- \int_compare:nNnT \l_graphics_page_int > 1
- { :P \int_use:N \l_graphics_page_int }
+ : \l_@@_pagebox_tl
+ \int_compare:nNnT \l_@@_page_int > 1
+ { :P \int_use:N \l_@@_page_int }
}
\@@_backend_getbb_auxi:n {#1}
}
\cs_new_protected:Npn \@@_backend_getbb_auxi:n #1
{
- \graphics_bb_restore:xF { #1 \l_@@_graphics_attr_tl }
+ \@@_bb_restore:xF { #1 \l_@@_graphics_attr_tl }
{ \@@_backend_getbb_auxii:n {#1} }
}
% \end{macrocode}
% Measuring the graphic is done by boxing up: for PDF graphics we could
% use |\tex_pdfximagebbox:D|, but if doesn't work for other types.
% As the box always starts at $(0,0)$ there is no need to worry about
-% the lower-left position.
+% the lower-left position. Quotes need to be \emph{removed} as \LuaTeX{}
+% does not like them here.
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_getbb_auxii:n #1
{
+ \exp_args:Ne \@@_backend_getbb_auxiii:n
+ { \@@_backend_dequote:w #1 " #1 " \s_@@_stop }
+ \int_const:cn { c_@@_ #1 \l_@@_graphics_attr_tl _int }
+ { \tex_the:D \tex_pdflastximage:D }
+ \@@_bb_save:x { #1 \l_@@_graphics_attr_tl }
+ }
+\cs_new_protected:Npn \@@_backend_getbb_auxiii:n #1
+ {
\tex_immediate:D \tex_pdfximage:D
\bool_lazy_or:nnT
- { \l_graphics_interpolate_bool }
- { ! \tl_if_empty_p:N \l_graphics_decodearray_tl }
+ { \l_@@_interpolate_bool }
+ { ! \tl_if_empty_p:N \l_@@_decodearray_str }
{
attr ~
{
- \tl_if_empty:NF \l_graphics_decodearray_tl
- { /Decode~[ \l_graphics_decodearray_tl ] }
- \bool_if:NT \l_graphics_interpolate_bool
+ \tl_if_empty:NF \l_@@_decodearray_str
+ { /Decode~[ \l_@@_decodearray_str ] }
+ \bool_if:NT \l_@@_interpolate_bool
{ /Interpolate~true }
}
}
- \int_compare:nNnT \l_graphics_page_int > 0
- { page ~ \int_use:N \l_graphics_page_int }
- \tl_if_empty:NF \l_graphics_pagebox_tl
- { \l_graphics_pagebox_tl }
+ \int_compare:nNnT \l_@@_page_int > 0
+ { page ~ \int_use:N \l_@@_page_int }
+ \tl_if_empty:NF \l_@@_pagebox_tl
+ { \l_@@_pagebox_tl }
{#1}
\hbox_set:Nn \l_@@_internal_box
{ \tex_pdfrefximage:D \tex_pdflastximage:D }
- \dim_set:Nn \l_graphics_urx_dim { \box_wd:N \l_@@_internal_box }
- \dim_set:Nn \l_graphics_ury_dim { \box_ht:N \l_@@_internal_box }
- \int_const:cn { c_@@_graphics_ #1 \l_@@_graphics_attr_tl _int }
- { \tex_the:D \tex_pdflastximage:D }
- \graphics_bb_save:x { #1 \l_@@_graphics_attr_tl }
+ \dim_set:Nn \l_@@_urx_dim { \box_wd:N \l_@@_internal_box }
+ \dim_set:Nn \l_@@_ury_dim { \box_ht:N \l_@@_internal_box }
}
+\cs_new:Npn \@@_backend_dequote:w #1 " #2 " #3 \s_@@_stop {#2}
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}
% {
-% \@@_backend_include_jpg:n,
-% \@@_backend_include_pdf:n,
+% \@@_backend_include_jpg:n ,
+% \@@_backend_include_jpeg:n ,
+% \@@_backend_include_pdf:n ,
% \@@_backend_include_png:n
% }
% Images are already loaded for the measurement part of the code, so
@@ -211,8 +274,9 @@
\cs_new_protected:Npn \@@_backend_include_jpg:n #1
{
\tex_pdfrefximage:D
- \int_use:c { c_@@_graphics_ #1 \l_@@_graphics_attr_tl _int }
+ \int_use:c { c_@@_ #1 \l_@@_graphics_attr_tl _int }
}
+\cs_new_eq:NN \@@_backend_include_jpeg:n \@@_backend_include_jpg:n
\cs_new_eq:NN \@@_backend_include_pdf:n \@@_backend_include_jpg:n
\cs_new_eq:NN \@@_backend_include_png:n \@@_backend_include_jpg:n
% \end{macrocode}
@@ -241,8 +305,12 @@
\l_@@_backend_ext_str
\exp_args:Nx \@@_backend_getbb_eps:nn
{
- \l_@@_backend_name_str - \str_tail:N \l_@@_backend_ext_str
- -converted-to.pdf
+ \exp_args:Ne \__kernel_file_name_quote:n
+ {
+ \l_@@_backend_name_str
+ - \str_tail:N \l_@@_backend_ext_str
+ -converted-to.pdf
+ }
}
{#1}
}
@@ -253,7 +321,7 @@
\sys_shell_now:n
{ repstopdf ~ #2 ~ #1 }
}
- \tl_set:Nn \l_graphics_name_tl {#1}
+ \tl_set:Nn \l_@@_final_name_str {#1}
\@@_backend_getbb_pdf:n {#1}
}
\cs_new_protected:Npn \@@_backend_include_eps:n #1
@@ -262,8 +330,12 @@
\l_@@_backend_dir_str \l_@@_backend_name_str \l_@@_backend_ext_str
\exp_args:Nx \@@_backend_include_pdf:n
{
- \l_@@_backend_name_str - \str_tail:N \l_@@_backend_ext_str
- -converted-to.pdf
+ \exp_args:Ne \__kernel_file_name_quote:n
+ {
+ \l_@@_backend_name_str
+ - \str_tail:N \l_@@_backend_ext_str
+ -converted-to.pdf
+ }
}
}
}
@@ -273,6 +345,18 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\@@_backend_get_pagecount:n}
+% Simply load and store.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_backend_get_pagecount:n #1
+ {
+ \tex_immediate:D \tex_pdfximage:D {#1}
+ \int_const:cn { c_@@_ #1 _pages_int }
+ { \int_use:N \tex_pdflastximagepages:D }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
%</luatex|pdftex>
% \end{macrocode}
@@ -283,28 +367,46 @@
%<*dvipdfmx|xetex>
% \end{macrocode}
%
+% \begin{variable}{\l_graphics_search_ext_seq}
+% \begin{macrocode}
+\@@_backend_loaded:n
+ {
+ \seq_set_from_clist:Nn \l_graphics_search_ext_seq
+ { .pdf , .eps , .ps , .png , .jpg ., jpeg , .bmp }
+ }
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macro}
% {
-% \@@_backend_getbb_eps:n, \@@_backend_getbb_jpg:n,
-% \@@_backend_getbb_pdf:n, \@@_backend_getbb_png:n
+% \@@_backend_getbb_eps:n ,
+% \@@_backend_getbb_jpg:n , \@@_backend_getbb_jpeg:n ,
+% \@@_backend_getbb_pdf:n , \@@_backend_getbb_png:n ,
+% \@@_backend_getbb_bmp:n
% }
% Simply use the generic functions: only for \texttt{dvipdfmx} in the
% extraction cases.
% \begin{macrocode}
-\cs_new_eq:NN \@@_backend_getbb_eps:n \graphics_read_bb:n
+\@@_backend_loaded:n
+ {
+ \cs_new_eq:NN \@@_backend_getbb_eps:n \@@_read_bb:n
+ \cs_new_eq:NN \@@_backend_getbb_ps:n \@@_read_bb:n
+ }
%<*dvipdfmx>
\cs_new_protected:Npn \@@_backend_getbb_jpg:n #1
{
- \int_zero:N \l_graphics_page_int
- \tl_clear:N \l_graphics_pagebox_tl
- \graphics_extract_bb:n {#1}
+ \int_zero:N \l_@@_page_int
+ \tl_clear:N \l_@@_pagebox_tl
+ \@@_extract_bb:n {#1}
}
+\cs_new_eq:NN \@@_backend_getbb_jpeg:n \@@_backend_getbb_jpg:n
\cs_new_eq:NN \@@_backend_getbb_png:n \@@_backend_getbb_jpg:n
+\cs_new_eq:NN \@@_backend_getbb_bmp:n \@@_backend_getbb_jpg:n
\cs_new_protected:Npn \@@_backend_getbb_pdf:n #1
{
- \tl_clear:N \l_graphics_decodearray_tl
- \bool_set_false:N \l_graphics_interpolate_bool
- \graphics_extract_bb:n {#1}
+ \tl_clear:N \l_@@_decodearray_str
+ \bool_set_false:N \l_@@_interpolate_bool
+ \@@_extract_bb:n {#1}
}
%</dvipdfmx>
% \end{macrocode}
@@ -319,8 +421,10 @@
%
% \begin{macro}
% {
-% \@@_backend_include_eps:n, \@@_backend_include_jpg:n,
-% \@@_backend_include_pdf:n, \@@_backend_include_png:n
+% \@@_backend_include_eps:n , \@@_backend_include_ps:n ,
+% \@@_backend_include_jpg:n , \@@_backend_include_jpseg:n ,
+% \@@_backend_include_pdf:n , \@@_backend_include_png:n ,
+% \@@_backend_include_bmp:n ,
% }
% \begin{macro}{\@@_backend_include_auxi:nn}
% \begin{macro}{\@@_backend_include_auxii:nnn, \@@_backend_include_auxii:xnn}
@@ -335,15 +439,18 @@
\__kernel_backend_literal:x
{
PSfile = #1 \c_space_tl
- llx = \dim_to_decimal_in_bp:n \l_graphics_llx_dim \c_space_tl
- lly = \dim_to_decimal_in_bp:n \l_graphics_lly_dim \c_space_tl
- urx = \dim_to_decimal_in_bp:n \l_graphics_urx_dim \c_space_tl
- ury = \dim_to_decimal_in_bp:n \l_graphics_ury_dim
+ llx = \dim_to_decimal_in_bp:n \l_@@_llx_dim \c_space_tl
+ lly = \dim_to_decimal_in_bp:n \l_@@_lly_dim \c_space_tl
+ urx = \dim_to_decimal_in_bp:n \l_@@_urx_dim \c_space_tl
+ ury = \dim_to_decimal_in_bp:n \l_@@_ury_dim
}
}
+\cs_new_eq:NN \@@_backend_include_ps:n \@@_backend_include_eps:n
\cs_new_protected:Npn \@@_backend_include_jpg:n #1
{ \@@_backend_include_auxi:nn {#1} { image } }
+\cs_new_eq:NN \@@_backend_include_jpeg:n \@@_backend_include_jpg:n
\cs_new_eq:NN \@@_backend_include_png:n \@@_backend_include_jpg:n
+\cs_new_eq:NN \@@_backend_include_bmp:n \@@_backend_include_jpg:n
%<*dvipdfmx>
\cs_new_protected:Npn \@@_backend_include_pdf:n #1
{ \@@_backend_include_auxi:nn {#1} { epdf } }
@@ -358,23 +465,23 @@
{
\@@_backend_include_auxii:xnn
{
- \tl_if_empty:NF \l_graphics_pagebox_tl
- { : \l_graphics_pagebox_tl }
- \int_compare:nNnT \l_graphics_page_int > 1
- { :P \int_use:N \l_graphics_page_int }
- \tl_if_empty:NF \l_graphics_decodearray_tl
- { :D \l_graphics_decodearray_tl }
- \bool_if:NT \l_graphics_interpolate_bool
+ \tl_if_empty:NF \l_@@_pagebox_tl
+ { : \l_@@_pagebox_tl }
+ \int_compare:nNnT \l_@@_page_int > 1
+ { :P \int_use:N \l_@@_page_int }
+ \tl_if_empty:NF \l_@@_decodearray_str
+ { :D \l_@@_decodearray_str }
+ \bool_if:NT \l_@@_interpolate_bool
{ :I }
}
{#1} {#2}
}
\cs_new_protected:Npn \@@_backend_include_auxii:nnn #1#2#3
{
- \int_if_exist:cTF { c_@@_graphics_ #2#1 _int }
+ \int_if_exist:cTF { c_@@_ #2#1 _int }
{
\__kernel_backend_literal:x
- { pdf:usexobj~@graphic \int_use:c { c_@@_graphics_ #2#1 _int } }
+ { pdf:usexobj~@graphic \int_use:c { c_@@_ #2#1 _int } }
}
{ \@@_backend_include_auxiii:nnn {#2} {#1} {#3} }
}
@@ -388,31 +495,31 @@
\cs_new_protected:Npn \@@_backend_include_auxiii:nnn #1#2#3
{
\int_gincr:N \g_@@_track_int
- \int_const:cn { c_@@_graphics_ #1#2 _int } { \g_@@_track_int }
+ \int_const:cn { c_@@_ #1#2 _int } { \g_@@_track_int }
\__kernel_backend_literal:x
{
pdf:#3~
- @graphic \int_use:c { c_@@_graphics_ #1#2 _int } ~
- \int_compare:nNnT \l_graphics_page_int > 1
- { page ~ \int_use:N \l_graphics_page_int \c_space_tl }
- \tl_if_empty:NF \l_graphics_pagebox_tl
+ @graphic \int_use:c { c_@@_ #1#2 _int } ~
+ \int_compare:nNnT \l_@@_page_int > 1
+ { page ~ \int_use:N \l_@@_page_int \c_space_tl }
+ \tl_if_empty:NF \l_@@_pagebox_tl
{
- pagebox ~ \l_graphics_pagebox_tl \c_space_tl
+ pagebox ~ \l_@@_pagebox_tl \c_space_tl
bbox ~
- \dim_to_decimal_in_bp:n \l_graphics_llx_dim \c_space_tl
- \dim_to_decimal_in_bp:n \l_graphics_lly_dim \c_space_tl
- \dim_to_decimal_in_bp:n \l_graphics_urx_dim \c_space_tl
- \dim_to_decimal_in_bp:n \l_graphics_ury_dim \c_space_tl
+ \dim_to_decimal_in_bp:n \l_@@_llx_dim \c_space_tl
+ \dim_to_decimal_in_bp:n \l_@@_lly_dim \c_space_tl
+ \dim_to_decimal_in_bp:n \l_@@_urx_dim \c_space_tl
+ \dim_to_decimal_in_bp:n \l_@@_ury_dim \c_space_tl
}
(#1)
\bool_lazy_or:nnT
- { \l_graphics_interpolate_bool }
- { ! \tl_if_empty_p:N \l_graphics_decodearray_tl }
+ { \l_@@_interpolate_bool }
+ { ! \tl_if_empty_p:N \l_@@_decodearray_str }
{
<<
- \tl_if_empty:NF \l_graphics_decodearray_tl
- { /Decode~[ \l_graphics_decodearray_tl ] }
- \bool_if:NT \l_graphics_interpolate_bool
+ \tl_if_empty:NF \l_@@_decodearray_str
+ { /Decode~[ \l_@@_decodearray_str ] }
+ \bool_if:NT \l_@@_interpolate_bool
{ /Interpolate~true> }
>>
}
@@ -424,6 +531,15 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\@@_backend_get_pagecount:n}
+% \begin{macrocode}
+%<*dvipdfmx>
+\@@_backend_loaded:n
+ { \cs_new_eq:NN \@@_backend_get_pagecount:n \@@_get_pagecount:n }
+%</dvipdfmx>
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
%</dvipdfmx|xetex>
% \end{macrocode}
@@ -434,13 +550,13 @@
%<*xetex>
% \end{macrocode}
%
-% \subsubsection{Images}
-%
% \begin{macro}
% {
-% \@@_backend_getbb_jpg:n,
-% \@@_backend_getbb_pdf:n,
-% \@@_backend_getbb_png:n
+% \@@_backend_getbb_jpg:n ,
+% \@@_backend_getbb_jpeg:n ,
+% \@@_backend_getbb_pdf:n ,
+% \@@_backend_getbb_png:n ,
+% \@@_backend_getbb_bmp:n
% }
% \begin{macro}{\@@_backend_getbb_auxi:nN}
% \begin{macro}{\@@_backend_getbb_auxii:nnN, \@@_backend_getbb_auxii:VnN}
@@ -456,21 +572,23 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_getbb_jpg:n #1
{
- \int_zero:N \l_graphics_page_int
- \tl_clear:N \l_graphics_pagebox_tl
+ \int_zero:N \l_@@_page_int
+ \tl_clear:N \l_@@_pagebox_tl
\@@_backend_getbb_auxi:nN {#1} \tex_XeTeXpicfile:D
}
+\cs_new_eq:NN \@@_backend_getbb_jpeg:n \@@_backend_getbb_jpg:n
\cs_new_eq:NN \@@_backend_getbb_png:n \@@_backend_getbb_jpg:n
+\cs_new_eq:NN \@@_backend_getbb_bmp:n \@@_backend_getbb_jpg:n
\cs_new_protected:Npn \@@_backend_getbb_pdf:n #1
{
- \tl_clear:N \l_graphics_decodearray_tl
- \bool_set_false:N \l_graphics_interpolate_bool
+ \tl_clear:N \l_@@_decodearray_str
+ \bool_set_false:N \l_@@_interpolate_bool
\@@_backend_getbb_auxi:nN {#1} \tex_XeTeXpdffile:D
}
\cs_new_protected:Npn \@@_backend_getbb_auxi:nN #1#2
{
- \int_compare:nNnTF \l_graphics_page_int > 1
- { \@@_backend_getbb_auxii:VnN \l_graphics_page_int {#1} #2 }
+ \int_compare:nNnTF \l_@@_page_int > 1
+ { \@@_backend_getbb_auxii:VnN \l_@@_page_int {#1} #2 }
{ \@@_backend_getbb_auxiii:nNnn {#1} #2 { :P 1 } { page 1 } }
}
\cs_new_protected:Npn \@@_backend_getbb_auxii:nnN #1#2#3
@@ -478,8 +596,8 @@
\cs_generate_variant:Nn \@@_backend_getbb_auxii:nnN { V }
\cs_new_protected:Npn \@@_backend_getbb_auxiii:nNnn #1#2#3#4
{
- \tl_if_empty:NTF \l_graphics_pagebox_tl
- { \@@_backend_getbb_auxiv:VnNnn \l_graphics_pagebox_tl }
+ \tl_if_empty:NTF \l_@@_pagebox_tl
+ { \@@_backend_getbb_auxiv:VnNnn \l_@@_pagebox_tl }
{ \@@_backend_getbb_auxv:nNnn }
{#1} #2 {#3} {#4}
}
@@ -488,21 +606,25 @@
\use:x
{
\@@_backend_getbb_auxv:nNnn {#2} #3 { : #1 #4 }
- { #5 ~ \@@_backend_getbb_pagebox:w #1 }
+ {
+ #5
+ \tl_if_blank:nF {#1}
+ { \c_space_tl \@@_backend_getbb_pagebox:w #1 }
+ }
}
}
\cs_generate_variant:Nn \@@_backend_getbb_auxiv:nnNnn { V }
\cs_new_protected:Npn \@@_backend_getbb_auxv:nNnn #1#2#3#4
{
- \graphics_bb_restore:nF {#1#3}
+ \@@_bb_restore:nF {#1#3}
{ \@@_backend_getbb_auxvi:nNnn {#1} #2 {#3} {#4} }
}
\cs_new_protected:Npn \@@_backend_getbb_auxvi:nNnn #1#2#3#4
{
\hbox_set:Nn \l_@@_internal_box { #2 #1 ~ #4 }
- \dim_set:Nn \l_graphics_urx_dim { \box_wd:N \l_@@_internal_box }
- \dim_set:Nn \l_graphics_ury_dim { \box_ht:N \l_@@_internal_box }
- \graphics_bb_save:n {#1#3}
+ \dim_set:Nn \l_@@_urx_dim { \box_wd:N \l_@@_internal_box }
+ \dim_set:Nn \l_@@_ury_dim { \box_ht:N \l_@@_internal_box }
+ \@@_bb_save:n {#1#3}
}
\cs_new:Npn \@@_backend_getbb_pagebox:w #1 box {#1}
% \end{macrocode}
@@ -515,7 +637,6 @@
% \end{macro}
%
% \begin{macro}{\@@_backend_include_pdf:n}
-% \begin{macro}{\@@_backend_include_bitmap_quote:w}
% For PDF graphics, properly supporting the |pagebox| concept in \XeTeX{}
% is best done using the |\tex_XeTeXpdffile:D| primitive. The syntax here
% is the same as for the graphic measurement part, although we know at this
@@ -523,16 +644,27 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_include_pdf:n #1
{
- \tex_XeTeXpdffile:D
- \@@_backend_include_pdf_quote:w #1 "#1" \s_@@_stop \c_space_tl
- \int_compare:nNnT \l_graphics_page_int > 0
- { page ~ \int_use:N \l_graphics_page_int \c_space_tl }
- \exp_after:wN \@@_backend_getbb_pagebox:w \l_graphics_pagebox_tl
+ \tex_XeTeXpdffile:D #1 ~
+ \int_compare:nNnT \l_@@_page_int > 0
+ { page ~ \int_use:N \l_@@_page_int \c_space_tl }
+ \exp_after:wN \@@_backend_getbb_pagebox:w \l_@@_pagebox_tl
}
-\cs_new:Npn \@@_backend_include_pdf_quote:w #1 " #2 " #3 \s_@@_stop
- { " #2 " }
% \end{macrocode}
% \end{macro}
+%
+% \begin{macro}{\@@_backend_get_pagecount:n}
+% Very little to do here other than cover the case of a non-PDF file.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_backend_get_pagecount:n #1
+ {
+ \int_const:cn { c_@@_ #1 _pages_int }
+ {
+ \int_max:nn
+ { \int_use:N \tex_XeTeXpdfpagecount:D #1 ~ }
+ { 1 }
+ }
+ }
+% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
@@ -545,22 +677,35 @@
%<*dvisvgm>
% \end{macrocode}
%
+% \begin{variable}{\l_graphics_search_ext_seq}
+% \begin{macrocode}
+\@@_backend_loaded:n
+ {
+ \seq_set_from_clist:Nn
+ \l_graphics_search_ext_seq
+ { .pdf , .eps , .png , .jpg , .jpeg }
+ }
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macro}{\@@_backend_getbb_eps:n}
% Simply use the generic function.
% \begin{macrocode}
-\cs_new_eq:NN \@@_backend_getbb_eps:n \graphics_read_bb:n
+\@@_backend_loaded:n
+ { \cs_new_eq:NN \@@_backend_getbb_eps:n \@@_read_bb:n }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_backend_getbb_png:n, \@@_backend_getbb_jpg:n}
+% \begin{macro}{\@@_backend_getbb_png:n, \@@_backend_getbb_jpg:n, \@@_backend_getbb_jpeg:n}
% These can be included by extracting the bounding box data.
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_getbb_jpg:n #1
{
- \int_zero:N \l_graphics_page_int
- \tl_clear:N \l_graphics_pagebox_tl
- \graphics_extract_bb:n {#1}
+ \int_zero:N \l_@@_page_int
+ \tl_clear:N \l_@@_pagebox_tl
+ \@@_extract_bb:n {#1}
}
+\cs_new_eq:NN \@@_backend_getbb_jpeg:n \@@_backend_getbb_jpg:n
\cs_new_eq:NN \@@_backend_getbb_png:n \@@_backend_getbb_jpg:n
% \end{macrocode}
% \end{macro}
@@ -570,9 +715,9 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_getbb_pdf:n #1
{
- \tl_clear:N \l_graphics_decodearray_tl
- \bool_set_false:N \l_graphics_interpolate_bool
- \graphics_extract_bb:n {#1}
+ \tl_clear:N \l_@@_decodearray_str
+ \bool_set_false:N \l_@@_interpolate_bool
+ \@@_extract_bb:n {#1}
}
% \end{macrocode}
% \end{macro}
@@ -583,25 +728,30 @@
% sizes here. (This is the same as the \texttt{dvips} code.)
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_include_eps:n #1
- { @@_backend_include:nn { PSfile } {#1} }
+ { \@@_backend_include:nn { PSfile } {#1} }
\cs_new_protected:Npn \@@_backend_include_pdf:n #1
- { @@_backend_include:nn { pdffile } {#1} }
+ { \@@_backend_include:nn { pdffile } {#1} }
\cs_new_protected:Npn \@@_backend_include:nn #1#2
{
\__kernel_backend_literal:x
{
#1 = #2 \c_space_tl
- llx = \dim_to_decimal_in_bp:n \l_graphics_llx_dim \c_space_tl
- lly = \dim_to_decimal_in_bp:n \l_graphics_lly_dim \c_space_tl
- urx = \dim_to_decimal_in_bp:n \l_graphics_urx_dim \c_space_tl
- ury = \dim_to_decimal_in_bp:n \l_graphics_ury_dim
+ llx = \dim_to_decimal_in_bp:n \l_@@_llx_dim \c_space_tl
+ lly = \dim_to_decimal_in_bp:n \l_@@_lly_dim \c_space_tl
+ urx = \dim_to_decimal_in_bp:n \l_@@_urx_dim \c_space_tl
+ ury = \dim_to_decimal_in_bp:n \l_@@_ury_dim
}
}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\@@_backend_include_png:n, \@@_backend_include_jpg:n}
+% \begin{macro}
+% {
+% \@@_backend_include_png:n ,
+% \@@_backend_include_jpg:n ,
+% \@@_backend_include_jpeg:n
+% }
% \begin{macro}{\@@_backend_include_bitmap_quote:w}
% The backend here has built-in support for basic graphic inclusion (see
% \texttt{dvisvgm.def} for a more complex approach, needed if clipping,
@@ -615,11 +765,12 @@
\__kernel_backend_literal:x
{
dvisvgm:img~
- \dim_to_decimal:n { \l_graphics_ury_dim } ~
- \dim_to_decimal:n { \l_graphics_ury_dim } ~
+ \dim_to_decimal:n { \l_@@_ury_dim } ~
+ \dim_to_decimal:n { \l_@@_ury_dim } ~
\@@_backend_include_bitmap_quote:w #1 " #1 " \s_@@_stop
}
}
+\cs_new_eq:NN \@@_backend_include_jpeg:n \@@_backend_include_png:n
\cs_new_eq:NN \@@_backend_include_jpg:n \@@_backend_include_png:n
\cs_new:Npn \@@_backend_include_bitmap_quote:w #1 " #2 " #3 \s_@@_stop
{ " #2 " }
@@ -627,6 +778,13 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\@@_backend_get_pagecount:n}
+% \begin{macrocode}
+\@@_backend_loaded:n
+ { \cs_new_eq:NN \@@_backend_get_pagecount:n \@@_get_pagecount:n }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
%</dvisvgm>
% \end{macrocode}
diff --git a/macros/latex/contrib/l3backend/l3backend-header.dtx b/macros/latex/contrib/l3backend/l3backend-header.dtx
index fe05e97760..5eacda7b9f 100644
--- a/macros/latex/contrib/l3backend/l3backend-header.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-header.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2022-02-07}
+% \date{Released 2022-04-10}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3backend/l3backend-opacity.dtx b/macros/latex/contrib/l3backend/l3backend-opacity.dtx
index a38736bc5a..89d60de0df 100644
--- a/macros/latex/contrib/l3backend/l3backend-opacity.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-opacity.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2022-02-07}
+% \date{Released 2022-04-10}
%
% \maketitle
%
@@ -239,49 +239,6 @@
% \end{macrocode}
%
% \begin{macrocode}
-%<*dvipdfmx|xdvipdfmx>
-% \end{macrocode}
-%
-% \begin{macro}{\@@_backend_select:n}
-% Older backends have no stack support, so everything is done directly.
-% \begin{macrocode}
-\int_compare:nNnT \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
- {
- \cs_gset_protected:Npn \@@_backend_select_aux:n #1
- {
- \tl_set:Nn \l_@@_backend_fill_tl {#1}
- \tl_set:Nn \l_@@_backend_stroke_tl {#1}
- \pdfmanagement_add:nnn { Page / Resources / ExtGState }
- { opacity #1 }
- { << /ca ~ #1 /CA ~ #1 >> }
- \__kernel_backend_literal_pdf:n { /opacity #1 ~ gs }
- }
- \cs_gset_protected:Npn \@@_backend_fill_stroke:nn #1#2
- {
- \str_if_eq:nnTF {#1} {#2}
- { \@@_backend_select_aux:n {#1} }
- {
- \tl_set:Nn \l_@@_backend_fill_tl {#1}
- \tl_set:Nn \l_@@_backend_stroke_tl {#2}
- \pdfmanagement_add:nnn { Page / Resources / ExtGState }
- { opacity.fill #1 }
- { << /ca ~ #1 >> }
- \pdfmanagement_add:nnn { Page / Resources / ExtGState }
- { opacity.stroke #1 }
- { << /CA ~ #2 >> }
- \__kernel_backend_literal_pdf:n
- { /opacity.fill #1 ~ gs /opacity.stroke #2 ~ gs }
- }
- }
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macrocode}
-%</dvipdfmx|xdvipdfmx>
-% \end{macrocode}
-%
-% \begin{macrocode}
%<*dvisvgm>
% \end{macrocode}
%
diff --git a/macros/latex/contrib/l3backend/l3backend-pdf.dtx b/macros/latex/contrib/l3backend/l3backend-pdf.dtx
index 7b642b1a46..03435b2454 100644
--- a/macros/latex/contrib/l3backend/l3backend-pdf.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-pdf.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2022-02-07}
+% \date{Released 2022-04-10}
%
% \maketitle
%
@@ -1421,19 +1421,13 @@
{ \@@_backend_link_begin:n {#1#2} }
\cs_new_protected:Npx \@@_backend_link_begin:n #1
{
- \int_compare:nNnF \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
- {
- \exp_not:N \int_gincr:N \exp_not:N \g_@@_backend_link_int
- }
+ \exp_not:N \int_gincr:N \exp_not:N \g_@@_backend_link_int
\@@_backend:x
{
bann ~
- \int_compare:nNnF \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
- {
- @pdf.lnk
- \exp_not:N \int_use:N \exp_not:N \g_@@_backend_link_int
- \c_space_tl
- }
+ @pdf.lnk
+ \exp_not:N \int_use:N \exp_not:N \g_@@_backend_link_int
+ \c_space_tl
<<
/Type /Annot
#1
@@ -1451,14 +1445,8 @@
% Available using the backend mechanism with a suitably-recent
% version.
% \begin{macrocode}
-\cs_new:Npx \@@_backend_link_last:
- {
- \int_compare:nNnF \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
- {
- @pdf.lnk
- \exp_not:N \int_use:N \exp_not:N \g_@@_backend_link_int
- }
- }
+\cs_new:Npn \@@_backend_link_last:
+ { @pdf.lnk \int_use:N \g_@@_backend_link_int }
% \end{macrocode}
% \end{macro}
%