Mercurial > octave
diff scripts/plot/util/print.m @ 27343:2c9795736894
print.m: Allow "-svgconvert" to be used for EPS output (bug #52764)
* print.m: Rework documentation about the -svgconvert option, PS, EPS and PDF
formats. Totally remove transparency from grid lines before printing to
PostScript outputs.
* __opengl_print__.m: Don't restrict teh -svgconvert option to non-PostScript
outputs.
* __print_parse_opts__.m: Provide a Ghostscript device name for EPS when using
-svgconvert.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Wed, 12 Jun 2019 21:58:16 +0200 |
parents | 0a62d9a6aa2d |
children | 8ff5628d8b55 |
line wrap: on
line diff
--- a/scripts/plot/util/print.m Fri Aug 16 13:13:33 2019 -0700 +++ b/scripts/plot/util/print.m Wed Jun 12 21:58:16 2019 +0200 @@ -114,20 +114,29 @@ ## Specifies whether the opengl (pixel-based) or painters (vector-based) ## renderer is used. This is equivalent to changing the figure's ## @qcode{"Renderer"} property. When the figure @code{RendererMode} property -## is @qcode{"auto"} Octave will use the @qcode{"opengl"} renderer for raster -## formats (e.g., JPEG) and @qcode{"painters"} for vector formats (e.g., PDF)@. +## is @qcode{"auto"} (the default) Octave will use the @qcode{"opengl"} renderer +## for raster formats (e.g., JPEG) and @qcode{"painters"} for vector formats +## (e.g., PDF). ## Those options are only supported for the "qt" graphics tookit. ## ## @item -svgconvert -## For OpenGL-based graphic toolkits, this enables a different backend -## toolchain with enhanced characteristics. The toolchain adds support for -## printing arbitrary characters and fonts in PDF outputs; it avoids some -## anti-aliasing artifacts in the rendering of patch and surface objects -## (particularly for 2-D scenes); and it supports transparency of line, patch, -## and surface objects. +## When using the -painters renderer, this enables a different backend +## toolchain with enhanced characteristics: ## -## This option only affects PDF outputs, unless it is combined with -## @option{-painters} option, in which case raster outputs are also affected. +## @table @asis +## @item Font handling: +## The actual font is embedded in the output file which allows for printing +## arbitrary characters and fonts in all vector formats. +## @item Output Simplification: +## By default, the @code{-painters} renders patch and surface objects +## using assemblies of triangles. This may lead to anti-aliasing +## artifacts when viewing the file. The @code{-svgconvert} option reconstructs +## polygons in order to avoid those artifacts (particularly for 2-D figures). +## @item Transparency: +## Allows for printing transparent graphics objects in PDF format. +## For PostScript formats the presence of any transparent object will cause the +## output to be rasterized. +## @end table ## ## Caution: @option{-svgconvert} may lead to inaccurate rendering of image ## objects. @@ -227,34 +236,39 @@ ## Vector Formats ## ## @table @code +## @item svg +## Scalable Vector Graphics. +## ## @item pdf ## @itemx pdfcrop -## Portable Document Format. The @code{pdfcrop} device removes the default -## surrounding page. +## Portable Document Format. The @code{pdf} device formats the figure for +## printing on paper. The size of the surrounding page and the position of the +## figure inside the page are defined by the +## @ref{XREFfigurepaperorientation,, paper* figure properties}. +## +## Use @code{pdfcrop} if you don't want the surrounding page. ## -## The OpenGL-based graphics toolkits have limited support for text. +## 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. +## +## @item eps(2) +## @itemx epsc(2) +## Encapsulated PostScript (level 1 and 2, mono and color). +## +## The OpenGL-based graphics toolkits always generate PostScript level 3.0. +## They have limited support for text unless using the @code{-svgconvert} +## option. ## 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. ## -## For an enhanced output with complete text support and basic transparency, -## use the @option{-svgconvert} option. -## -## @item ps -## @itemx ps2 -## @itemx psc -## @itemx psc2 -## PostScript (level 1 and 2, mono and color). The OpenGL-based graphics -## toolkits always generate PostScript level 3.0 and have limited support for -## text. -## -## @item eps -## @itemx eps2 -## @itemx epsc -## @itemx epsc2 -## Encapsulated PostScript (level 1 and 2, mono and color). The -## OpenGL-based toolkits always generate PostScript level 3.0 and have -## limited support for text. +## @item ps(2) +## @itemx psc(2) +## Same as @code{eps} except that the figure is formated for printing on +## paper. The size of the surrounding page and position of the figure inside +## the page are defined by the +## @ref{XREFfigurepaperorientation,, paper* figure properties}. ## ## @item pslatex ## @itemx epslatex @@ -293,9 +307,6 @@ ## the graph portion of the plot. The @samp{standalone} variants behave as ## described for @samp{epslatexstandalone} above. ## -## @item svg -## Scalable Vector Graphics -## ## @item canvas* ## Javascript-based drawing on an HTML5 canvas viewable in a web browser. ## @@ -515,6 +526,16 @@ set (hax(n), "gridcolor", [0.85 0.85 0.85]); nfig += 2; endif + if (strcmp (get (hax(n), "gridalphamode"), "auto")) + props(end+1).h = hax(n); + props(end).name = "gridalphamode"; + props(end).value = {"auto"}; + props(end+1).h = hax(n); + props(end).name = "gridalpha"; + props(end).value = {get(hax(n), "gridalpha")}; + set (hax(n), "gridalpha", 1); + nfig += 2; + endif if (strcmp (get (hax(n), "minorgridcolormode"), "auto")) props(end+1).h = hax(n); @@ -526,6 +547,16 @@ set (hax(n), "minorgridcolor", [0.75 0.75 0.75]); nfig += 2; endif + if (strcmp (get (hax(n), "minorgridalphamode"), "auto")) + props(end+1).h = hax(n); + props(end).name = "minorgridalphamode"; + props(end).value = {"auto"}; + props(end+1).h = hax(n); + props(end).name = "minorgridalpha"; + props(end).value = {get(hax(n), "minorgridalpha")}; + set (hax(n), "minorgridalpha", 1); + nfig += 2; + endif endfor endif