[latex3-commits] [git/LaTeX3-latex3-pdfresources] backendtest: stashing ... (1962eee)
Ulrike Fischer
fischer at troubleshooting-tex.de
Wed Jul 10 10:58:16 CEST 2019
Repository : https://github.com/latex3/pdfresources
On branch : backendtest
Link : https://github.com/latex3/pdfresources/commit/1962eee5fe2b4d342e4ef23fe18cb0c51b85af03
>---------------------------------------------------------------
commit 1962eee5fe2b4d342e4ef23fe18cb0c51b85af03
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Wed Jul 10 10:58:16 2019 +0200
stashing ...
>---------------------------------------------------------------
1962eee5fe2b4d342e4ef23fe18cb0c51b85af03
experiments/dvips-texttransparency.tex | 53 +++++++++++++++++++++++-----------
experiments/extgstate.tex | 51 ++++++++++++++++++++++++++++++++
pdfresources.dtx | 32 +++++++++++---------
3 files changed, 106 insertions(+), 30 deletions(-)
diff --git a/experiments/dvips-texttransparency.tex b/experiments/dvips-texttransparency.tex
index 2c527b2..8df8e1a 100644
--- a/experiments/dvips-texttransparency.tex
+++ b/experiments/dvips-texttransparency.tex
@@ -1,32 +1,51 @@
+% !Mode:: "TeX:DE:UTF-8:Main"
\documentclass{article}
-\usepackage{lipsum,l3pdf}
+\usepackage{lipsum,l3pdf,xcolor}
\ExplSyntaxOn
\pdf_uncompress:
+\makeatletter
+\cs_new_protected:Npn\__pdf_backend_set_textopacity:n #1
+ {\tl_show:N\current at color
+ \exp_args:Nx\__kernel_backend_literal:n {color~push~\current at color\c_space_tl#1~.setopacityalpha}
+ \group_insert_after:N\__pdf_backend_reset_color:
+ }
+
+\cs_new_protected:Npn\__pdf_backend_reset_color:
+ {
+ \__kernel_backend_literal:n{color~pop}
+ }
+
+\cs_set_eq:NN \pdf_set_textopacity:n \__pdf_backend_set_textopacity:n
\ExplSyntaxOff
+
\begin{document}
+\ExplSyntaxOn \makeatletter
+
% \special{color push Black 0.5 .setopacityalpha} %not ok!!
-\special{background rgb 1 1 0 0.5 .setopacityalpha}
-\special{color push rgb 1 0 0 0.5 .setopacityalpha}
-\lipsum[1]
-\special{color push rgb 0 0 1}
+%\special{background rgb 1 1 0 0.5 .setopacityalpha}
+%\special{color push rgb 1 0 0 1 .setopacityalpha}
+\lipsum[1] xxx
+{\color{red}
+%\special{color push rgb 1 0 0 0.5 .setopacityalpha}
\lipsum[1]
-\special{color push rgb 0 0 1 1.0 .setopacityalpha}
-\lipsum[1]
-\special{color push cmyk 0.5 0 1 0 0.8 .setopacityalpha}
+%\special{color~push~rgb~1~0~0~0.5~.setopacityalpha}
+\pdf_set_textopacity:n{0.5}
+xxxx\pdf_set_textopacity:n{1}\lipsum[1]
+%\special{color push cmyk 0.5 0 1 0 0.8 .setopacityalpha}
\lipsum[2]
-\special{color push gray 0.8 0.2 .setopacityalpha}
+%\special{color push gray 0.8 0.2 .setopacityalpha}
\lipsum[1]
-\special{color pop}
-End!
-\special{color pop}
+%\special{color pop}
+End!}
+%#\special{color pop}
End!
-\special{color pop}
+%\special{color pop}
End!
-\special{color pop}
+%\special{color pop}
End!
-\special{color pop}
+%\special{color pop}
End!
-\special{background rgb 1 1 0 1 .setopacityalpha}
-
+%\special{background rgb 1 1 0 1 .setopacityalpha}
+\ExplSyntaxOff
\end{document}
\ No newline at end of file
diff --git a/experiments/extgstate.tex b/experiments/extgstate.tex
new file mode 100644
index 0000000..8df8e1a
--- /dev/null
+++ b/experiments/extgstate.tex
@@ -0,0 +1,51 @@
+% !Mode:: "TeX:DE:UTF-8:Main"
+\documentclass{article}
+
+\usepackage{lipsum,l3pdf,xcolor}
+\ExplSyntaxOn
+\pdf_uncompress:
+\makeatletter
+\cs_new_protected:Npn\__pdf_backend_set_textopacity:n #1
+ {\tl_show:N\current at color
+ \exp_args:Nx\__kernel_backend_literal:n {color~push~\current at color\c_space_tl#1~.setopacityalpha}
+ \group_insert_after:N\__pdf_backend_reset_color:
+ }
+
+\cs_new_protected:Npn\__pdf_backend_reset_color:
+ {
+ \__kernel_backend_literal:n{color~pop}
+ }
+
+\cs_set_eq:NN \pdf_set_textopacity:n \__pdf_backend_set_textopacity:n
+\ExplSyntaxOff
+
+\begin{document}
+\ExplSyntaxOn \makeatletter
+
+% \special{color push Black 0.5 .setopacityalpha} %not ok!!
+%\special{background rgb 1 1 0 0.5 .setopacityalpha}
+%\special{color push rgb 1 0 0 1 .setopacityalpha}
+\lipsum[1] xxx
+{\color{red}
+%\special{color push rgb 1 0 0 0.5 .setopacityalpha}
+\lipsum[1]
+%\special{color~push~rgb~1~0~0~0.5~.setopacityalpha}
+\pdf_set_textopacity:n{0.5}
+xxxx\pdf_set_textopacity:n{1}\lipsum[1]
+%\special{color push cmyk 0.5 0 1 0 0.8 .setopacityalpha}
+\lipsum[2]
+%\special{color push gray 0.8 0.2 .setopacityalpha}
+\lipsum[1]
+%\special{color pop}
+End!}
+%#\special{color pop}
+End!
+%\special{color pop}
+End!
+%\special{color pop}
+End!
+%\special{color pop}
+End!
+%\special{background rgb 1 1 0 1 .setopacityalpha}
+\ExplSyntaxOff
+\end{document}
\ No newline at end of file
diff --git a/pdfresources.dtx b/pdfresources.dtx
index 0c67cd4..1b04dba 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -329,7 +329,7 @@
% \pdf_pagesattr_gremove:n
% }
% \begin{syntax}
-% \pdf_pagesattr_gremove:n \Arg{name}
+% \cs{pdf_pagesattr_gremove:n} \Arg{name}
% \end{syntax}
% Removes |/|\meta{name} and its associated \meta{value} from the |/Pages| dictionary
% (if the name-value pair has been added by \cs{pdf_pagesattr_gput:nn}).
@@ -624,7 +624,7 @@
% \pdf_pageattr_gremove:n
% }
% \begin{syntax}
-% \pdf_pageattr_gremove:n \Arg{name}
+% \cs{pdf_pageattr_gremove:n} \Arg{name}
% \end{syntax}
% Removes |/|\meta{name} and its associated \meta{value} added by \cs{pdf_pageattr_gput:nn}
% from the page dictionaries of the current and the following pages.
@@ -698,7 +698,7 @@
% \pdf_info_gput:nn
% }
% \begin{syntax}
-% \pdf_info_gput:nn \Arg{name} \Arg{value}
+% \cs{pdf_info_gput:nn} \Arg{name} \Arg{value}
% \end{syntax}
% Adds |/|\meta{name} and the \meta{value} to the info dictionary.
% \meta{name} should be a valid pdf name without the leading slash,
@@ -719,7 +719,7 @@
% \pdf_info_string_gput:nn
% }
% \begin{syntax}
-% \pdf_info_string_gput:nn \Arg{name} \Arg{value}
+% \cs{pdf_info_string_gput:nn} \Arg{name} \Arg{value}
% \end{syntax}
% Adds |/|\meta{name} and the \meta{value} surrounded by parentheses to the info dictionary.
% \meta{name} should be a valid pdf name without the leading slash,
@@ -783,19 +783,20 @@
% \pdf_bdc:nn
% }
% \begin{syntax}
-% \pdf_bdc:nn \Arg{tag} \Arg{object name}
+% \cs{pdf_bdc:nn} \Arg{tag} \Arg{object name}
% \end{syntax}
% This command adds a BDC marked content operator to the current page stream.
% \meta{tag} is the tag of this operator (without the leading slash),
% \meta{object name} is a the name of an dictionary object reserved with
-% \cs{pdf_object_new:nn} and filled with \cs{\pdf_object_write:n} with
+% \cs{pdf_object_new:nn} and filled with \cs{pdf_object_write:n} with
% the properties of the BDC.
+% \end{function}
% \begin{function}[added = 2019-06-30]
% {
% \pdf_emc:
% }
% \begin{syntax}
-% \pdf_emc:
+% \cs{pdf_emc:}
% \end{syntax}
% This command closes the BDC marked content operator opened with \cs{pdf_bdc:nn}.
% It should be one the same page as the bdc-command.
@@ -820,11 +821,11 @@
{
\cs_set_protected:Npn \@@_backend_bdc:nn #1 #2 % #1 eg. Span, #2: object name
{
- \special{ps:~mark~/#1~\@@_backend_object_ref:n{#2}~BDC~pdfmark}
+ \special {ps:~mark~/#1~\@@_backend_object_ref:n{#2}~BDC~pdfmark}
}
\cs_set_protected:Npn \@@_backend_emc:
{
- \special{ps:~mark~/EMC~pdfmark} %
+ \special {ps:~mark~/EMC~pdfmark} %
}
\cs_new_protected:Npn \@@_backend_PageN_Resources_gpush:n #1 {}
}
@@ -835,8 +836,12 @@
\cs_set_protected:Npn \@@_backend_bdc:nn #1 #2 % #1 eg. Span, #2: object name
{
\int_gincr:N \g_@@_backend_name_int
- \special{pdf:code~/#1/l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl BDC}
- \special{
+ \__kernel_backend_literal:x
+ {
+ pdf:code~/#1/l3pdf\int_use:N\g_@@_backend_name_int\c_space_tl BDC
+ }
+ \__kernel_backend_literal:x
+ {
pdf:put~@resources~
<<
/Properties~
@@ -849,7 +854,7 @@
}
\cs_set_protected:Npn \@@_backend_emc:
{
- \special{pdf:code~EMC} %pdfbase
+ \__kernel_backend_literal:n {pdf:code~EMC} %pdfbase
}
\cs_new_protected:Npn \@@_backend_PageN_Resources_gpush:n #1 {}
}
@@ -923,6 +928,7 @@
}
%</package>
% \end{macrocode}
+% \subsection{page resources / ExtGState, ColorSpace, Shading, Pattern }
% ===================================
%\subsubsection{pdfxform}
% \begin{NOTE}{UF}
@@ -1091,7 +1097,7 @@
ColorSpace,
Pattern,
Shading,
- Properties
+ % Properties
}
\prop_new:N \g_@@_pageresources_prop
More information about the latex3-commits
mailing list