changeset 31432:df8bdaf1164b

print.m: Use -svgconvert by default (bug #62979) * NEW.8.md: Announce the change. * print.m: Reword the documentation. Document the new "-nosvgconvert" option. * __print_parse_opts__.m: Make svgconvert option true by default. Check for new "-nosvgconvert" option.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Mon, 29 Aug 2022 18:29:24 +0200
parents 84e8f0bf83f7
children 9d4ef8d54bfe
files etc/NEWS.8.md scripts/plot/util/print.m scripts/plot/util/private/__print_parse_opts__.m
diffstat 3 files changed, 15 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS.8.md	Tue Nov 15 09:36:55 2022 -0800
+++ b/etc/NEWS.8.md	Mon Aug 29 18:29:24 2022 +0200
@@ -45,6 +45,11 @@
 
 ### Graphics backend
 
+- When printing, the option `-svgconvert` is now the default.  If you want to
+use the more limited EPS-based tool chain (the former default)&mdash;e.g., if
+you encounter inaccurate image rendering&mdash;you can pass the `-nosvgconvert`
+option to the `print` function.
+
 - Additional properties have been added to the `figure` graphics object:
     * `"innerposition"` (equivalent to `"position"`)
     * `"windowstate"` (not yet implemented)
--- a/scripts/plot/util/print.m	Tue Nov 15 09:36:55 2022 -0800
+++ b/scripts/plot/util/print.m	Mon Aug 29 18:29:24 2022 +0200
@@ -127,9 +127,10 @@
 ## JPEG) and @qcode{"painters"} for vector formats (e.g., PDF)@.  These options
 ## are only supported for the "qt" graphics toolkit.
 ##
-## @item -svgconvert
-##   When using the @option{-painters} renderer, this enables a different
-## backend toolchain with enhanced characteristics:
+## @item -svgconvert (default)
+## @item -nosvgconvert
+##   When using the @option{-painters} renderer, this enables or disables the
+## SVG based backend toolchain with enhanced characteristics:
 ##
 ## @table @asis
 ## @item Font handling:
@@ -263,9 +264,8 @@
 ##
 ## Use @code{pdfcrop} if you don't want the surrounding page.
 ##
-## By default, PDF inherits the same limitations as PostScript.
-## For an enhanced output with complete text support and basic transparency,
-## use the @option{-svgconvert} option.
+## Caution: with @option{-nosvgconvert} option, PDF inherits the same
+## limitations as PostScript (limited set of fonts and lack of transparency).
 ##
 ##   @item  eps(2)
 ##   @itemx epsc(2)
@@ -273,7 +273,7 @@
 ##
 ## The OpenGL-based graphics toolkits always generate PostScript level 3.0.
 ## They have limited support for text unless using the @option{-svgconvert}
-## option.
+## option (the default).
 ## Limitations include using only ASCII characters (e.g., no Greek letters)
 ## and support for just three base PostScript fonts: Helvetica (the default),
 ## Times, or Courier.  Any other font will be replaced by Helvetica.
--- a/scripts/plot/util/private/__print_parse_opts__.m	Tue Nov 15 09:36:55 2022 -0800
+++ b/scripts/plot/util/private/__print_parse_opts__.m	Mon Aug 29 18:29:24 2022 +0200
@@ -69,7 +69,7 @@
   arg_st.rgb_output = false;
   arg_st.send_to_printer = false;
   arg_st.special_flag = "textnormal";
-  arg_st.svgconvert = false;
+  arg_st.svgconvert = true;
   arg_st.svgconvert_binary = __quote_path__ (__svgconv_binary__ ());
   arg_st.tight = true;
   arg_st.use_color = 0; # 0=default, -1=mono, +1=color
@@ -125,6 +125,8 @@
         arg_st.tight = true;
       elseif (strcmp (arg, "-svgconvert"))
         arg_st.svgconvert = true;
+      elseif (strcmp (arg, "-nosvgconvert"))
+        arg_st.svgconvert = false;
       elseif (strcmp (arg, "-textspecial"))
         arg_st.special_flag = "textspecial";
       elseif (strcmp (arg, "-fillpage"))
@@ -236,11 +238,6 @@
              arg_st.devopt);
   endif
 
-  ## By default, postprocess svg files using svgconvert.
-  if (strcmp (arg_st.devopt, "svg"))
-    arg_st.svgconvert = true;
-  endif
-
   ## By default, use the "opengl" renderer for all raster outputs
   ## supported by "imwrite".
   fmts = imformats ();