[latex3-commits] [git/LaTeX3-latex3-latex3] master: /FitR support in dvipdfmx (0b07ff1)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu May 2 18:22:32 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/0b07ff16f524ff47b018c232aa4bb55ad99039f4

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

commit 0b07ff16f524ff47b018c232aa4bb55ad99039f4
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu May 2 17:22:32 2019 +0100

    /FitR support in dvipdfmx
    
    Thanks to Alexander Grahn:
    reveals a possible bug in dvipdfmx with rotation


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

0b07ff16f524ff47b018c232aa4bb55ad99039f4
 l3kernel/l3drivers-pdf.dtx |   29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/l3kernel/l3drivers-pdf.dtx b/l3kernel/l3drivers-pdf.dtx
index fd8270c..dc297ba 100644
--- a/l3kernel/l3drivers-pdf.dtx
+++ b/l3kernel/l3drivers-pdf.dtx
@@ -1767,8 +1767,9 @@
 % \end{macro}
 %
 % \begin{macro}{\driver_pdf_destination:nn, \driver_pdf_destination_rectangle:nn}
-%   Here, we need to turn the zoom into a scale.
-%   A little translation
+%   Here, we need to turn the zoom into a scale. The method for \texttt{FitR}
+%   is from Alexander Grahn: the idea is to avoid needing to do any calculations
+%   in \TeX{} by using the driver data for \texttt{@xpos} and \texttt{@ypos}.
 %    \begin{macrocode}
 \cs_new_protected:Npn \driver_pdf_destination:nn #1#2
   {
@@ -1795,7 +1796,31 @@
   {
     \group_begin:
       \hbox_set:Nn \l_@@_pdf_tmp_box {#2}
+      \box_move_down:nn { \box_dp:N \l_@@_pdf_tmp_box }
+        {
+          \hbox:n
+            {
+              \@@_pdf:n { obj ~ @driver_#1_llx ~ @xpos }
+              \@@_pdf:n { obj ~ @driver_#1_lly ~ @ypos }
+            }
+        }
       \box_use:N \l_@@_pdf_tmp_box
+      \box_move_up:nn { \box_ht:N \l_@@_pdf_tmp_box }
+        {
+          \hbox:n
+            {
+              \@@_pdf:n
+                {
+                  dest ~ (#1)
+                  [
+                    @thispage
+                    /FitR ~
+                      @driver_#1_llx ~ @driver_#1_lly ~
+                      @xpos ~ @ypos
+                  ]
+                }
+            }
+        }
     \group_end:    
   }
 %    \end{macrocode}





More information about the latex3-commits mailing list