[latex3-commits] [git/LaTeX3-latex3-pdfresources] renamedict77: added xform exist test (67d2ae2)

Ulrike Fischer fischer at troubleshooting-tex.de
Wed Apr 29 11:20:40 CEST 2020


Repository : https://github.com/latex3/pdfresources
On branch  : renamedict77
Link       : https://github.com/latex3/pdfresources/commit/67d2ae29eebfc7f6ccdc8a6c34a521e45650f4f3

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

commit 67d2ae29eebfc7f6ccdc8a6c34a521e45650f4f3
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed Apr 29 11:20:40 2020 +0200

    added xform exist test


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

67d2ae29eebfc7f6ccdc8a6c34a521e45650f4f3
 pdfresources.dtx | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/pdfresources.dtx b/pdfresources.dtx
index 56bc488..6ead748 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -2796,6 +2796,16 @@
 %    These command give back the sizes of the XObject. The values are stored in
 %    tl-variables with the unit pt and not in dimensions!
 %   \end{function}
+%   \begin{function}[EXP,pTF,added = 220-04-29]
+%     {
+%       \pdf_xform_if_exist:n
+%     }
+%   \begin{syntax}
+%     \cs{pdf_xform_if_exist_p:n} \Arg{name}
+%     \cs{pdf_xform_if_exist:NTF} \meta{name} \Arg{true code} \Arg{false code}
+%   \end{syntax}
+%    These command tests if an xform with name \Arg{name} has been already defined.
+%   \end{function}%
 %    \begin{macrocode}
 \cs_new_protected:Npn  \pdf_xform_new:nnn #1 #2 #3
   {
@@ -2829,6 +2839,9 @@
     \tl_use:c { c_@@_backend_xform_dp_ \tl_to_str:n { #1 } _tl }
   }
 
+\prg_new_eq_conditional:NNn \pdf_xform_if_exist:n\__pdf_backend_xform_if_exist:n
+  { TF , T , F , p }
+
 %    \end{macrocode}
 %
 %  \subsubsection{Form XObject / backend }
@@ -3102,6 +3115,13 @@
        \box_use_drop:N \l_@@_tmpa_box
      }
   }
+%% all
+\prg_new_conditional:Npnn \__pdf_backend_xform_if_exist:n #1 { p , T , F , TF }
+  {
+    \int_if_exist:cTF { c__pdf_backend_xform_ \tl_to_str:n {#1} _int }
+     { \prg_return_true: }
+     { \prg_return_false:}
+  }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}





More information about the latex3-commits mailing list.