[latex3-commits] [git/LaTeX3-latex3-latex3] setpdfpagesize-alt: Support \mag for DVI-based routes (fbf5a92c1)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Jun 23 16:12:41 CEST 2022


Repository : https://github.com/latex3/latex3
On branch  : setpdfpagesize-alt
Link       : https://github.com/latex3/latex3/commit/fbf5a92c15400e0f599256e5af0d81b253fd70fc

>---------------------------------------------------------------

commit fbf5a92c15400e0f599256e5af0d81b253fd70fc
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Jun 23 15:11:50 2022 +0100

    Support \mag for DVI-based routes
    
    Fingers-crossed ...


>---------------------------------------------------------------

fbf5a92c15400e0f599256e5af0d81b253fd70fc
 l3backend/l3backend-pdf.dtx | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/l3backend/l3backend-pdf.dtx b/l3backend/l3backend-pdf.dtx
index 6e31c0120..f6f2d58bb 100644
--- a/l3backend/l3backend-pdf.dtx
+++ b/l3backend/l3backend-pdf.dtx
@@ -1687,8 +1687,10 @@
 %    \end{macrocode}
 %
 % \begin{macro}{\@@_backend_pagesize_set:nn}
+% \begin{macro}[EXP]{\@@_backend_pagesize_set:n}
 %   This is done as a backend literal, so we deal with it using the shipout
-%   hook.
+%   hook. The inclusion of \cs{tex_mag:D} here is essentially to work with
+%   (u)p\LaTeX{}, where this is used to adjust apparent font size.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_backend_pagesize_set:nn #1#2
   {
@@ -1698,17 +1700,22 @@
           {
 %<*dvipdfmx>
             pdf:pagesize ~
-              width  ~ \dim_eval:n {#1} ~
-              height ~ \dim_eval:n {#2}
+              width  ~ \@@_backend_pagesize_set:n {#1} ~
+              height ~ \@@_backend_pagesize_set:n {#2}
 %</dvipdfmx>
 %<*dvips>
-            papersize = \dim_eval:n {#1} , \dim_eval:n {#2}
+            papersize =
+              \@@_backend_pagesize_set:n {#1} ,
+              \@@_backend_pagesize_set:n {#2}
 %</dvips>
           }
       }
   }
+\cs_new:Npn \@@_backend_pagesize_set:n #1
+  { \fp_to_dim:n { \tex_mag:D / 1000 * (#1) } }
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
 %    \begin{macrocode}
 %</dvipdfmx|dvips>





More information about the latex3-commits mailing list.