[latex3-commits] [git/LaTeX3-latex3-pdfresources] reworking-annot: adapted pdfborder, pdfborderstyle to dict use (8ad8107)

Ulrike Fischer fischer at troubleshooting-tex.de
Wed Jan 13 16:10:04 CET 2021


Repository : https://github.com/latex3/pdfresources
On branch  : reworking-annot
Link       : https://github.com/latex3/pdfresources/commit/8ad8107bbe2aa24163819151e5d6bb7f2f007a55

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

commit 8ad8107bbe2aa24163819151e5d6bb7f2f007a55
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed Jan 13 16:10:04 2021 +0100

    adapted pdfborder, pdfborderstyle to dict use


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

8ad8107bbe2aa24163819151e5d6bb7f2f007a55
 hyperref-generic.dtx  | 119 +++++++++++++++++++++++++++++---------------------
 hyperreflinktypes.tex |   2 +-
 2 files changed, 70 insertions(+), 51 deletions(-)

diff --git a/hyperref-generic.dtx b/hyperref-generic.dtx
index d725488..00c4467 100644
--- a/hyperref-generic.dtx
+++ b/hyperref-generic.dtx
@@ -1056,34 +1056,6 @@
 %    \begin{macrocode}
 \pdfannot_link_margin:n { 1pt }
 
-\cs_new_protected:Npn \Hy at EXPsetpdfborder
-  {
-    \seq_map_inline:Nn \c_pdfannot_link_types_seq
-      {
-        \tl_if_empty:NTF \@pdfborder
-          {
-            \pdfannot_dict_remove:nn {link/##1}{Border}
-          }
-          {
-            \exp_args:Nnnx
-             \pdfannot_dict_put:nnn
-              {link/##1}
-              { Border }
-              { [\@pdfborder] }
-          }
-        \tl_if_empty:NTF \@pdfborderstyle
-          {
-            \pdfannot_dict_remove:nn {link/##1} { BS }
-          }
-          {
-            \exp_args:Nnnx
-             \pdfannot_dict_put:nnn
-              {link/##1}
-              { BS }
-              { <<\@pdfborderstyle>> }
-          }
-      }
-  }
 
 % highlight
 \cs_new_protected:Npn \Hy at EXPsetpdfhighlight
@@ -1127,7 +1099,7 @@
 % some better method must be found
 \NewDocumentCommand\hypupdateattribute { }
  {
-   \Hy at EXPsetpdfborder
+   %\Hy at EXPsetpdfborder
    \Hy at EXPsetpdfhighlight
    \Hy at EXPsetbordercolor
  }
@@ -2142,37 +2114,77 @@
   {
     ,pdfborder  .code:n =
       {
-        \tl_set:Nn \@pdfborder {#1}
-        \tl_if_empty:nTF { #1}
-          {
-            \seq_map_inline:Nn\c_pdfannot_link_types_seq
-              {
-                \exp_args:Nnnx
-                \pdfannot_dict_remove:nn
-                  {link/##1}
+        \tl_if_empty:nTF { #1 }
+         {
+           \prop_map_inline:Nn \c_@@_map_hyp_annot_prop
+             {
+               \pdfannot_dict_remove:nn
+                  {link/##2}
                   { Border }
-              }
-          }
+             }
+         }
+         {
+           \prop_map_inline:Nn \c_@@_map_hyp_annot_prop
+             {
+               \pdfannot_dict_put:nnn
+                 {link/##2}
+                 { Border }
+                 { [#1] }
+             }
+         }
+      }
+    ,pdfborder .initial:n = {0~0~1},
+  }
+
+\prop_map_inline:Nn \c_@@_map_hyp_annot_prop
+  {
+    \keys_define:nn { hyp / setup }
+      {
+        #1borderstyle .code:n =
           {
-            \seq_map_inline:Nn\c_pdfannot_link_types_seq
-              {
-                \exp_args:Nnnx
-                \pdfannot_dict_put:nnn
-                  {link/##1}
-                  { Border }
-                  { [#1] }
-              }
+             \tl_if_empty:nTF { ##1 }
+               {
+                 \pdfannot_dict_remove:nn
+                  {link/#2}
+                  { BS }
+               }
+               {
+                 \pdfannot_dict_put:nnn
+                   {link/#2}
+                   { BS }
+                   { <<##1>> }
+               }
           }
       }
   }
 \keys_define:nn { hyp / setup }
   {
-    ,pdfborder .initial:n = {0~0~1},
-    ,pdfborderstyle .code:n =
+    ,pdfborderstyle  .code:n =
       {
-        \tl_set:Nn \@pdfborderstyle {#1}
+        \tl_if_empty:nTF { #1 }
+         {
+           \prop_map_inline:Nn \c_@@_map_hyp_annot_prop
+             {
+               \pdfannot_dict_remove:nn
+                  {link/##2}
+                  { BS }
+             }
+         }
+         {
+           \prop_map_inline:Nn \c_@@_map_hyp_annot_prop
+             {
+               \pdfannot_dict_put:nnn
+                 {link/##2}
+                 { BS }
+                 { <<#1>> }
+             }
+         }
       }
     ,pdfborderstyle .initial:n = {},
+  }
+
+\keys_define:nn { hyp / setup }
+  {
     ,colorlinks .meta:n = {pdfborder={0~0~0},pdfborderstyle={}}
     ,ocgcolorlinks .meta:n = {pdfborder={0~0~0},pdfborderstyle={}}
   }
@@ -2449,6 +2461,13 @@
   }
 
 
+%%%%%%%%%%%%%% Temporary stuff
+\prop_map_inline:Nn \c_@@_map_hyp_annot_prop
+  {
+    \define at key{Hyp}{#1border}{}
+    \define at key{Hyp}{#1borderstyle}{}
+  }
+%%%%%%%%%%%%%%%%%
 \NewDocumentCommand \MakeFieldObject { m m }
   {
     \pdf_xform_new:nnn { #2 }{} { #1 }
diff --git a/hyperreflinktypes.tex b/hyperreflinktypes.tex
index c2a98ab..b6cb7e4 100644
--- a/hyperreflinktypes.tex
+++ b/hyperreflinktypes.tex
@@ -13,7 +13,7 @@ Internal links
    \hyper at linkstart{link}{\Hy at tocdestname} (toc)
 
  internal command
-  \find at pdflink{#1}{#2} --> new name: \__hyp_link_dest_begin:nw
+  \find at pdflink{#1}{#2} --> new name: \__hyp_link_goto_begin:nw
    defined in driver,
    used only in driver
   ->  \pdf_annot_link_goto_begin:nnw { link } { #2 }





More information about the latex3-commits mailing list.