[latex3-commits] [git/LaTeX3-latex3-latex3] master: Support /FitR with dvips in landscape pages (8a6a0aa)

Joseph Wright joseph.wright at morningstar2.co.uk
Tue Apr 30 16:09:22 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/8a6a0aac9df58d1695cae9ac0ca920ab48ea4b6f

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

commit 8a6a0aac9df58d1695cae9ac0ca920ab48ea4b6f
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Tue Apr 30 15:09:22 2019 +0100

    Support /FitR with dvips in landscape pages
    
    Thanks to AlexG


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

8a6a0aac9df58d1695cae9ac0ca920ab48ea4b6f
 l3kernel/l3drivers-pdf.dtx |   52 +++++++++++++++++++++++++++++++++-----------
 1 file changed, 39 insertions(+), 13 deletions(-)

diff --git a/l3kernel/l3drivers-pdf.dtx b/l3kernel/l3drivers-pdf.dtx
index d5e04ba..efd2c64 100644
--- a/l3kernel/l3drivers-pdf.dtx
+++ b/l3kernel/l3drivers-pdf.dtx
@@ -318,11 +318,21 @@
 %     driver.dest.anchor ,
 %     driver.dest.x      ,
 %     driver.dest.y      ,
-%     driver.dest.point
+%     driver.dest.point  ,
+%     driver.dest2device ,
+%     driver.dev.x       ,
+%     driver.dev.y       ,
+%     driver.tmpa        ,
+%     driver.tmpb        ,
+%     driver.tmpc        ,
+%     driver.tmpd
 %   }
 %   For finding the anchor point of a destination link. We make the use case
 %   a separate function as it comes up a lot, and as this makes it easier to
-%   adjust if we need additional effects.
+%   adjust if we need additional effects. We also need a more complex approach
+%   to convert a co-ordinate pair correctly when defining a rectangle: this
+%   can otherwise be out when using a landscape page. (Thanks to Alexander
+%   Grahn for the approach here.)
 %    \begin{macrocode}
 \@@_postscript_header:n
   {
@@ -338,6 +348,29 @@
         def
     /driver.dest.point
       { driver.dest.x ~ driver.dest.y } def
+   /driver.dest2device
+     {
+       /driver.dest.y ~ exch ~ def
+       /driver.dest.x ~ exch ~ def ~
+       matrix ~ currentmatrix ~
+       matrix ~ defaultmatrix ~
+       matrix ~ invertmatrix ~
+       matrix ~ concatmatrix ~
+       cvx ~ exec
+       /driver.dev.y ~ exch ~ def
+       /driver.dev.x ~ exch ~ def
+       /driver.tmpd ~ exch ~ def
+       /driver.tmpc ~ exch ~ def
+       /driver.tmpb ~ exch ~ def
+       /driver.tmpa ~ exch ~ def ~
+       driver.dest.x ~ driver.tmpa ~ mul ~
+         driver.dest.y ~ driver.tmpc ~ mul ~ add ~
+         driver.dev.x ~ add ~
+       driver.dest.x ~ driver.tmpb ~ mul ~
+         driver.dest.y ~ driver.tmpd ~ mul ~ add ~
+         driver.dev.y ~ add
+     }
+       def
   }
 %    \end{macrocode}
 % \end{macro}
@@ -1060,7 +1093,6 @@
 % \end{macro}
 %
 % \begin{macro}{\driver_pdf_destination:nn, \driver_pdf_destination_rectangle:nn}
-% \begin{macro}{driver.dest.llx, driver.dest.lly}
 %   Here, we need to turn the zoom into a scale. We also need to know where
 %   the current anchor point actually is: worked out in PostScript. For the
 %   rectangle version, we have a bit more PostScript: we need two points.
@@ -1096,23 +1128,18 @@
       \hbox_set:Nn \l_@@_pdf_tmp_box {#2}
       \box_move_down:nn
         { \box_dp:N \l_@@_pdf_tmp_box }
-        { \hbox:n { \@@_postscript:n { driver.dest.anchor } } }
+        { \hbox:n { \@@_postscript:n { driver.save.ll } } }
       \box_use:N \l_@@_pdf_tmp_box
-      \@@_postscript:n
-        {
-          SDict /driver.dest.llx ~ driver.dest.x ~ put ~
-          SDict /driver.dest.lly ~ driver.dest.y ~ put
-        }
       \box_move_up:nn
         { \box_ht:N \l_@@_pdf_tmp_box }
-        { \hbox:n { \@@_postscript:n { driver.dest.anchor } } }
+        { \hbox:n { \@@_postscript:n { driver.save.ur } } }
       \@@_pdfmark:n
         {
           /View
           [
             /FitR ~
-              driver.dest.llx ~ driver.dest.lly ~
-              driver.dest.x   ~ driver.dest.y
+              driver.llx ~ driver.lly ~ driver.dest2device ~
+              driver.urx ~ driver.ury ~ driver.dest2device
           ]
           /Dest ( #1 ) cvn
           /DEST
@@ -1121,7 +1148,6 @@
   }
 %    \end{macrocode}
 % \end{macro}
-% \end{macro}
 %
 % \subsubsection{Structure}
 %





More information about the latex3-commits mailing list