[latex3-commits] [git/LaTeX3-latex3-latex3] main: Papersize backend should be gset (a30463986)
Joseph Wright
joseph.wright at morningstar2.co.uk
Sat Jan 14 13:44:10 CET 2023
Repository : https://github.com/latex3/latex3
On branch : main
Link : https://github.com/latex3/latex3/commit/a304639868666b5b2d4bb5c29933bde70ac16628
>---------------------------------------------------------------
commit a304639868666b5b2d4bb5c29933bde70ac16628
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Sat Jan 14 12:44:10 2023 +0000
Papersize backend should be gset
>---------------------------------------------------------------
a304639868666b5b2d4bb5c29933bde70ac16628
l3backend/l3backend-pdf.dtx | 14 +++++++-------
l3kernel/l3pdf.dtx | 39 ++++++++++++++++++++++++++++++++++++---
2 files changed, 43 insertions(+), 10 deletions(-)
diff --git a/l3backend/l3backend-pdf.dtx b/l3backend/l3backend-pdf.dtx
index ebe374b28..8f8901854 100644
--- a/l3backend/l3backend-pdf.dtx
+++ b/l3backend/l3backend-pdf.dtx
@@ -2,7 +2,7 @@
%
%% File: l3backend-pdf.dtx
%
-% Copyright (C) 2019-2022 The LaTeX Project
+% Copyright (C) 2019-2023 The LaTeX Project
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -1709,11 +1709,11 @@
%<*dvipdfmx|dvips>
% \end{macrocode}
%
-% \begin{macro}{\@@_backend_pagesize_set:nn}
+% \begin{macro}{\@@_backend_pagesize_gset:nn}
% This is done as a backend literal, so we deal with it using the shipout
% hook.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_backend_pagesize_set:nn #1#2
+\cs_new_protected:Npn \@@_backend_pagesize_gset:nn #1#2
{
\__kernel_backend_first_shipout:n
{
@@ -1741,10 +1741,10 @@
%<*luatex|pdftex|xetex>
% \end{macrocode}
%
-% \begin{macro}{\@@_backend_pagesize_set:nn}
+% \begin{macro}{\@@_backend_pagesize_gset:nn}
% Pass to the primitives.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_backend_pagesize_set:nn #1#2
+\cs_new_protected:Npn \@@_backend_pagesize_gset:nn #1#2
{
\dim_set:Nn \tex_pagewidth:D {#1}
\dim_set:Nn \tex_pageheight:D {#2}
@@ -1760,10 +1760,10 @@
%<*dvisvgm>
% \end{macrocode}
%
-% \begin{macro}{\@@_backend_pagesize_set:nn}
+% \begin{macro}{\@@_backend_pagesize_gset:nn}
% A no-op.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_backend_pagesize_set:nn #1#2 { }
+\cs_new_protected:Npn \@@_backend_pagesize_gset:nn #1#2 { }
% \end{macrocode}
% \end{macro}
%
diff --git a/l3kernel/l3pdf.dtx b/l3kernel/l3pdf.dtx
index c29dbe414..19f17ceb5 100644
--- a/l3kernel/l3pdf.dtx
+++ b/l3kernel/l3pdf.dtx
@@ -2,7 +2,7 @@
%
%% File: l3pdf.dtx
%
-% Copyright(C) 2019-2022 The LaTeX Project
+% Copyright(C) 2019-2023 The LaTeX Project
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -162,6 +162,16 @@
% Expands to the currently-active PDF version.
% \end{function}
%
+% \section{Page (media) size}
+%
+% \begin{function}[added = 2023-01-14]{\pdf_pagesize_gset:nn}
+% \begin{syntax}
+% \cs{pdf_pagesize_gset:nn}} \Arg{width} \Arg{height}
+% \end{syntax}
+% Sets the page size (mediabox) of the PDF being created to the
+% \meta{width} and \meta{height}, both of which are \meta{dimexpr}.
+% \end{function}
+%
% \section{Compression}
%
% \begin{function}[added = 2021-02-10]{\pdf_uncompress:}
@@ -474,6 +484,29 @@
% \end{macrocode}
% \end{macro}
%
+% \subsection{Page size}
+%
+% \begin{macro}{\pdf_pagesize_gset:nn}
+% Split the version and set.
+% \begin{macrocode}
+\cs_new_protected:Npn \pdf_version_gset:n #1
+ { \@@_version_gset:w #1 . . \s_@@_stop }
+\cs_new_protected:Npn \pdf_version_min_gset:n #1
+ {
+ \pdf_version_compare:NnT < {#1}
+ { \@@_version_gset:w #1 . . \s_@@_stop }
+ }
+\cs_new_protected:Npn \@@_version_gset:w #1 . #2 . #3\s_@@_stop
+ {
+ \bool_if:NF \g_@@_init_bool
+ {
+ \@@_backend_version_major_gset:n {#1}
+ \@@_backend_version_minor_gset:n {#2}
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Destinations}
%
% \begin{macro}{\pdf_destination:nn}
@@ -515,7 +548,7 @@
{ \dim_compare_p:nNn \stockheight > { 0pt } }
{ \dim_compare_p:nNn \stockwidth > { 0pt } }
{
- \@@_backend_pagesize_set:nn
+ \@@_backend_pagesize_gset:nn
\stockwidth \stockheight
}
{
@@ -527,7 +560,7 @@
{ \dim_compare_p:nNn \paperheight > { 0pt } }
{ \dim_compare_p:nNn \paperwidth > { 0pt } }
{
- \@@_backend_pagesize_set:nn
+ \@@_backend_pagesize_gset:nn
\paperwidth \paperheight
}
}
More information about the latex3-commits
mailing list.