[latex3-commits] [git/LaTeX3-latex3-latex3] master: Object refs for breakable links in dvips (ece9969)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon May 27 09:34:12 CEST 2019


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

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

commit ece99690ade1d12d3999272d156ca4967e959bca
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon May 27 08:32:01 2019 +0100

    Object refs for breakable links in dvips
    
    Approach from Raimund Niedrist, author of hypdvips.


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

ece99690ade1d12d3999272d156ca4967e959bca
 l3kernel/l3drivers-pdf.dtx |   44 +++++++++++++++++++-------------------------
 1 file changed, 19 insertions(+), 25 deletions(-)

diff --git a/l3kernel/l3drivers-pdf.dtx b/l3kernel/l3drivers-pdf.dtx
index eb62090..2cdc703 100644
--- a/l3kernel/l3drivers-pdf.dtx
+++ b/l3kernel/l3drivers-pdf.dtx
@@ -630,6 +630,19 @@
       def
     /driver.breaklink.write
       {
+        counttomark ~ 1 ~ sub ~
+        index /_objdef ~ eq
+          {
+            counttomark ~ -2 ~ roll ~
+            dup ~ wcheck ~
+              {
+                readonly ~
+                counttomark ~ 2 ~ roll
+              }
+              { pop ~ pop }
+            ifelse
+          }
+        if ~
         counttomark ~ 1 ~ add ~ copy ~
         pop ~ driver.currentrect
         /ANN ~ pdfmark
@@ -645,8 +658,7 @@
 %     driver.pdfmark.good ,
 %     driver.outerbox     ,
 %     driver.baselineskip ,
-%     driver.pdfmark.dict ,
-%     driver.pdfmark.obj
+%     driver.pdfmark.dict
 %   }
 %   The business end of breaking links starts by hooking into |pdfmarks|.
 %   Unlike \pkg{hypdvips}, we avoid altering any links we have not created
@@ -676,11 +688,9 @@
                     Rect ~ 1 ~ get ~ sub ~
                     driver.baselineskip ~ div ~ round ~ cvi ~ 0 ~ gt
                       { driver.breaklink }
-                      { driver.pdfmark.obj }
-                    ifelse
+                    if
                   }
-                  { driver.pdfmark.obj }
-                ifelse ~
+                if ~
               end ~
             SDict /driver.outerbox ~ undef ~
             SDict /driver.baselineskip ~ undef ~
@@ -713,8 +723,6 @@
         loop
     }
       def
-  /driver.pdfmark.obj
-    { /_objdef ~ exch ~ driver.link.obj ~ exch } def
   }
 %    \end{macrocode}
 % \end{macro}
@@ -835,22 +843,18 @@
 %    \end{macrocode}
 % \end{variable}
 %
-% \begin{variable}{\l_@@_breaklink_obj_tl, \l_@@_breaklink_pdfmark_tl}
+% \begin{variable}{\l_@@_breaklink_pdfmark_tl}
 %   Swappable content for link breaking.
 %    \begin{macrocode}
-\tl_new:N \l_@@_breaklink_obj_tl
-\tl_set:Nn \l_@@_breaklink_obj_tl
-  { /_objdef ~  { driver.obj \int_use:N \g_@@_pdf_link_int } }
 \tl_new:N \l_@@_breaklink_pdfmark_tl
 \tl_set:Nn \l_@@_breaklink_pdfmark_tl { pdfmark }
 %    \end{macrocode}
 % \end{variable}
 %
-% \begin{macro}{\@@_breaklink_postscript:n, \@@_breaklink_postscript:x}
+% \begin{macro}{\@@_breaklink_postscript:n}
 %   To allow dropping material unless link breaking is active.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_breaklink_postscript:n #1 { }
-\cs_generate_variant:Nn \@@_breaklink_postscript:n { x }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -874,7 +878,6 @@
 %     driver.llx, driver.lly ,
 %     driver.ury, driver.ury ,
 %     driver.link.dict       ,
-%     driver.link.obj        ,
 %     driver.outerbox        ,
 %     driver.baselineskip
 %   }
@@ -959,18 +962,10 @@
       }
     \int_gincr:N \g_@@_pdf_object_int
     \int_gset_eq:NN \g_@@_pdf_link_int \g_@@_pdf_object_int
-    \@@_breaklink_postscript:x
-      {
-        /driver.link.obj
-          {
-            { driver.obj \int_use:N \g_@@_pdf_link_int \c_space_tl driver.cvs }
-          }
-            def
-      }
     \@@_postscript:x
       {
         mark
-        \l_@@_breaklink_obj_tl
+        /_objdef { driver.obj \int_use:N \g_@@_pdf_link_int }
         \g_@@_pdf_link_dict_tl \c_space_tl
         driver.rect
         /ANN ~ \l_@@_breaklink_pdfmark_tl
@@ -1086,7 +1081,6 @@
                   }
               }
           }
-        \tl_clear:N \l_@@_breaklink_obj_tl
         \tl_set:Nn \l_@@_breaklink_pdfmark_tl { driver.pdfmark }
         \cs_set_eq:NN \@@_breaklink_postscript:n \@@_postscript:n
         \cs_set_eq:NN \@@_breaklink_usebox:N \hbox_unpack:N





More information about the latex3-commits mailing list