[latex3-commits] [git/LaTeX3-latex3-latex3] master: Better naming for PDF object compression interface (fixes #571) (ad7fa54)
Joseph Wright
joseph.wright at morningstar2.co.uk
Tue May 7 11:43:39 CEST 2019
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/ad7fa54093d36a97d1b6806fb7ca57cd08b95276
>---------------------------------------------------------------
commit ad7fa54093d36a97d1b6806fb7ca57cd08b95276
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Tue May 7 10:43:39 2019 +0100
Better naming for PDF object compression interface (fixes #571)
>---------------------------------------------------------------
ad7fa54093d36a97d1b6806fb7ca57cd08b95276
l3kernel/CHANGELOG.md | 5 +++++
l3kernel/l3drivers-pdf.dtx | 36 ++++++++++++++++---------------
l3kernel/l3drivers.dtx | 12 +++++++----
l3kernel/testfiles/m3expl001.luatex.tlg | 5 ++---
l3kernel/testfiles/m3expl001.ptex.tlg | 3 +--
l3kernel/testfiles/m3expl001.tlg | 5 ++---
l3kernel/testfiles/m3expl001.uptex.tlg | 3 +--
l3kernel/testfiles/m3expl001.xetex.tlg | 3 +--
l3kernel/testfiles/m3expl003.luatex.tlg | 5 ++---
l3kernel/testfiles/m3expl003.ptex.tlg | 3 +--
l3kernel/testfiles/m3expl003.tlg | 5 ++---
l3kernel/testfiles/m3expl003.uptex.tlg | 3 +--
l3kernel/testfiles/m3expl003.xetex.tlg | 3 +--
13 files changed, 46 insertions(+), 45 deletions(-)
diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index ee291e4..48ab0f1 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -11,6 +11,11 @@ this project uses date-based 'snapshot' version identifiers.
- `.muskip:N` property
+### Changed
+
+- Experimental `\driver_pdf_compress_objects:n` replaces
+ `\driver_pdf_objects_(en|dis)able:`
+
## [2019-05-05]
### Added
diff --git a/l3kernel/l3drivers-pdf.dtx b/l3kernel/l3drivers-pdf.dtx
index 5c60b16..0dd13c0 100644
--- a/l3kernel/l3drivers-pdf.dtx
+++ b/l3kernel/l3drivers-pdf.dtx
@@ -1186,12 +1186,11 @@
% \subsubsection{Structure}
%
% \begin{macro}{\driver_pdf_compresslevel:n}
-% \begin{macro}{\driver_pdf_objects_enable:, \driver_pdf_objects_disable:}
+% \begin{macro}{\driver_pdf_compress_objects:n}
% These are all no-ops.
% \begin{macrocode}
\cs_new_protected:Npn \driver_pdf_compresslevel:n #1 { }
-\cs_new_protected:Npn \driver_pdf_objects_enable: { }
-\cs_new_protected:Npn \driver_pdf_objects_disable: { }
+\cs_new_protected:Npn \driver_pdf_compress_objects:n #1 { }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1459,8 +1458,8 @@
% \subsubsection{Structure}
%
% \begin{macro}{\driver_pdf_compresslevel:n}
-% \begin{macro}{\driver_pdf_objects_enable:, \driver_pdf_objects_disable:}
-% \begin{macro}{\@@_pdf_objectlevel:n}
+% \begin{macro}{\driver_pdf_compress_objects:n}
+% \begin{macro}{\@@_pdf_objcompresslevel:n}
% Simply pass data to the engine.
% \begin{macrocode}
\cs_new_protected:Npx \driver_pdf_compresslevel:n #1
@@ -1470,11 +1469,13 @@
{ \tex_pdfvariable:D compresslevel }
\exp_not:N \int_value:w \exp_not:N \int_eval:n {#1} \scan_stop:
}
-\cs_new_protected:Npn \driver_pdf_objects_enable:
- { \@@_pdf_objectlevel:n { 2 } }
-\cs_new_protected:Npn \driver_pdf_objects_disable:
- { \@@_pdf_objectlevel:n { 0 } }
-\cs_new_protected:Npx \@@_pdf_objectlevel:n #1
+\cs_new_protected:Npn \driver_pdf_compress_objects:n #1
+ {
+ \str_if_eq:nnTF {#1} { true }
+ { \@@_pdf_objcompresslevel:n { 2 } }
+ { \@@_pdf_objcompresslevel:n { 0 } }
+ }
+\cs_new_protected:Npx \@@_pdf_objcompresslevel:n #1
{
\cs_if_exist:NTF \tex_pdfobjcompresslevel:D
{ \tex_pdfobjcompresslevel:D }
@@ -1830,14 +1831,16 @@
% \subsubsection{Structure}
%
% \begin{macro}{\driver_pdf_compresslevel:n}
-% \begin{macro}{\driver_pdf_objects_enable:, \driver_pdf_objects_disable:}
+% \begin{macro}{\driver_pdf_compress_objects:n}
% Pass data to the driver: these are a one-shot.
% \begin{macrocode}
\cs_new_protected:Npn \driver_pdf_compresslevel:n #1
{ \@@_literal:x { dvipdfmx:config~z~ \int_eval:n {#1} } }
-\cs_new_protected:Npn \driver_pdf_objects_enable: { }
-\cs_new_protected:Npn \driver_pdf_objects_disable:
- { \@@_literal:n { dvipdfmx:config~C~0x40 } }
+\cs_new_protected:Npn \driver_pdf_compress_objects:n #1
+ {
+ \str_if_eq:nnF {#1} { true }
+ { \@@_literal:n { dvipdfmx:config~C~0x40 } }
+ }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1905,12 +1908,11 @@
% \subsubsection{Structure}
%
% \begin{macro}{\driver_pdf_compresslevel:n}
-% \begin{macro}{\driver_pdf_objects_enable:, \driver_pdf_objects_disable:}
+% \begin{macro}{\driver_pdf_compress_objects:n}
% These are all no-ops.
% \begin{macrocode}
\cs_new_protected:Npn \driver_pdf_compresslevel:n #1 { }
-\cs_new_protected:Npn \driver_pdf_objects_enable: { }
-\cs_new_protected:Npn \driver_pdf_objects_disable: { }
+\cs_new_protected:Npn \driver_pdf_compress_objects:n #1 { }
% \end{macrocode}
% \end{macro}
% \end{macro}
diff --git a/l3kernel/l3drivers.dtx b/l3kernel/l3drivers.dtx
index 791f9bf..cd328e7 100644
--- a/l3kernel/l3drivers.dtx
+++ b/l3kernel/l3drivers.dtx
@@ -644,15 +644,19 @@
% be set only once.
% \end{function}
%
-% \begin{function}{\driver_pdf_objects_enable:, \driver_pdf_objects_disable:}
+% \begin{function}[added = 2019-05-07]{\driver_pdf_objects:}
% \begin{syntax}
-% \cs{driver_pdf_objects_disable:}
+% \cs{driver_pdf_compress_objects:n} \Arg{switch}
% \end{syntax}
-% Enables or disables the creation of PDF objects. These objects are used to
+% Enables or disables the compression of non-stream objects when writing
+% the PDF. This depends on the \meta{switch}: either \texttt{true} or
+% \texttt{false}). Compression of non-stream objects is used to
% reduce the size of PDFs, and typically are enabled as standard. When used
% with \texttt{(x)dvipdfmx}, object creation can be disabled but not
% re-enabled, and this setting may only be applied globally: it should
-% be set only once.
+% be set only once. Note that for \texttt{dvips} this setting has no action,
+% as control of this functionality is dependent on the conversion from
+% PostScript to PDF.
% \end{function}
%
% \begin{function}[EXP, added = 2019-04-11]
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index ae75fe6..685823c 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -6503,9 +6503,8 @@ Defining \driver_pdf_object_write:nn on line ...
Defining \__driver_exp_not_i:nn on line ...
Defining \__driver_exp_not_ii:nn on line ...
Defining \driver_pdf_compresslevel:n on line ...
-Defining \driver_pdf_objects_enable: on line ...
-Defining \driver_pdf_objects_disable: on line ...
-Defining \__driver_pdf_objectlevel:n on line ...
+Defining \driver_pdf_compress_objects:n on line ...
+Defining \__driver_pdf_objcompresslevel:n on line ...
Defining \driver_pdf_version_major_gset:n on line ...
Defining \driver_pdf_version_minor_gset:n on line ...
Defining \driver_pdf_version_major: on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index bcc8184..0f2c084 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -6513,8 +6513,7 @@ Defining \driver_pdf_link_margin:n on line ...
Defining \driver_pdf_destination:nn on line ...
Defining \driver_pdf_destination_rectangle:nn on line ...
Defining \driver_pdf_compresslevel:n on line ...
-Defining \driver_pdf_objects_enable: on line ...
-Defining \driver_pdf_objects_disable: on line ...
+Defining \driver_pdf_compress_objects:n on line ...
Defining \driver_pdf_version_major:n on line ...
Defining \driver_pdf_version_minor:n on line ...
Defining \driver_pdf_version_major: on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index b0ec9eb..8cb92ce 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -6801,9 +6801,8 @@ Defining \driver_pdf_object_write:nn on line ...
Defining \__driver_exp_not_i:nn on line ...
Defining \__driver_exp_not_ii:nn on line ...
Defining \driver_pdf_compresslevel:n on line ...
-Defining \driver_pdf_objects_enable: on line ...
-Defining \driver_pdf_objects_disable: on line ...
-Defining \__driver_pdf_objectlevel:n on line ...
+Defining \driver_pdf_compress_objects:n on line ...
+Defining \__driver_pdf_objcompresslevel:n on line ...
Defining \driver_pdf_version_major_gset:n on line ...
Defining \driver_pdf_version_minor_gset:n on line ...
Defining \driver_pdf_version_major: on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 763089e..0794d22 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -6810,8 +6810,7 @@ Defining \driver_pdf_link_margin:n on line ...
Defining \driver_pdf_destination:nn on line ...
Defining \driver_pdf_destination_rectangle:nn on line ...
Defining \driver_pdf_compresslevel:n on line ...
-Defining \driver_pdf_objects_enable: on line ...
-Defining \driver_pdf_objects_disable: on line ...
+Defining \driver_pdf_compress_objects:n on line ...
Defining \driver_pdf_version_major:n on line ...
Defining \driver_pdf_version_minor:n on line ...
Defining \driver_pdf_version_major: on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 215d8b2..4ad126a 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -6523,8 +6523,7 @@ Defining \driver_pdf_link_margin:n on line ...
Defining \driver_pdf_destination:nn on line ...
Defining \driver_pdf_destination_rectangle:nn on line ...
Defining \driver_pdf_compresslevel:n on line ...
-Defining \driver_pdf_objects_enable: on line ...
-Defining \driver_pdf_objects_disable: on line ...
+Defining \driver_pdf_compress_objects:n on line ...
Defining \driver_pdf_version_major:n on line ...
Defining \driver_pdf_version_minor:n on line ...
Defining \driver_pdf_version_major: on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index ae75fe6..685823c 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -6503,9 +6503,8 @@ Defining \driver_pdf_object_write:nn on line ...
Defining \__driver_exp_not_i:nn on line ...
Defining \__driver_exp_not_ii:nn on line ...
Defining \driver_pdf_compresslevel:n on line ...
-Defining \driver_pdf_objects_enable: on line ...
-Defining \driver_pdf_objects_disable: on line ...
-Defining \__driver_pdf_objectlevel:n on line ...
+Defining \driver_pdf_compress_objects:n on line ...
+Defining \__driver_pdf_objcompresslevel:n on line ...
Defining \driver_pdf_version_major_gset:n on line ...
Defining \driver_pdf_version_minor_gset:n on line ...
Defining \driver_pdf_version_major: on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index bcc8184..0f2c084 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -6513,8 +6513,7 @@ Defining \driver_pdf_link_margin:n on line ...
Defining \driver_pdf_destination:nn on line ...
Defining \driver_pdf_destination_rectangle:nn on line ...
Defining \driver_pdf_compresslevel:n on line ...
-Defining \driver_pdf_objects_enable: on line ...
-Defining \driver_pdf_objects_disable: on line ...
+Defining \driver_pdf_compress_objects:n on line ...
Defining \driver_pdf_version_major:n on line ...
Defining \driver_pdf_version_minor:n on line ...
Defining \driver_pdf_version_major: on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index b0ec9eb..8cb92ce 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -6801,9 +6801,8 @@ Defining \driver_pdf_object_write:nn on line ...
Defining \__driver_exp_not_i:nn on line ...
Defining \__driver_exp_not_ii:nn on line ...
Defining \driver_pdf_compresslevel:n on line ...
-Defining \driver_pdf_objects_enable: on line ...
-Defining \driver_pdf_objects_disable: on line ...
-Defining \__driver_pdf_objectlevel:n on line ...
+Defining \driver_pdf_compress_objects:n on line ...
+Defining \__driver_pdf_objcompresslevel:n on line ...
Defining \driver_pdf_version_major_gset:n on line ...
Defining \driver_pdf_version_minor_gset:n on line ...
Defining \driver_pdf_version_major: on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 763089e..0794d22 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -6810,8 +6810,7 @@ Defining \driver_pdf_link_margin:n on line ...
Defining \driver_pdf_destination:nn on line ...
Defining \driver_pdf_destination_rectangle:nn on line ...
Defining \driver_pdf_compresslevel:n on line ...
-Defining \driver_pdf_objects_enable: on line ...
-Defining \driver_pdf_objects_disable: on line ...
+Defining \driver_pdf_compress_objects:n on line ...
Defining \driver_pdf_version_major:n on line ...
Defining \driver_pdf_version_minor:n on line ...
Defining \driver_pdf_version_major: on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 215d8b2..4ad126a 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -6523,8 +6523,7 @@ Defining \driver_pdf_link_margin:n on line ...
Defining \driver_pdf_destination:nn on line ...
Defining \driver_pdf_destination_rectangle:nn on line ...
Defining \driver_pdf_compresslevel:n on line ...
-Defining \driver_pdf_objects_enable: on line ...
-Defining \driver_pdf_objects_disable: on line ...
+Defining \driver_pdf_compress_objects:n on line ...
Defining \driver_pdf_version_major:n on line ...
Defining \driver_pdf_version_minor:n on line ...
Defining \driver_pdf_version_major: on line ...
More information about the latex3-commits
mailing list