# HG changeset patch # User Pantxo Diribarne # Date 1547713535 -3600 # Node ID bf05a7c16e9e014ecf36878fe1c7019e60eae531 # Parent f8d380d04b01e7db553b383dfede619f19e2b55a Choose "painters" renderer when printing rotated text (bug #55485) * __print_parse_opt__.m: Do not choose opengl renderer when some text objects have angles other that multiples of 90°. * print.m: Document that the renderer options are only implemented for the qt toolkit. diff -r f8d380d04b01 -r bf05a7c16e9e scripts/plot/util/print.m --- a/scripts/plot/util/print.m Thu Jan 17 08:04:53 2019 -0800 +++ b/scripts/plot/util/print.m Thu Jan 17 09:25:35 2019 +0100 @@ -116,6 +116,7 @@ ## @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). +## Those options are only supported for the "qt" graphics tookit. ## ## @item -svgconvert ## For OpenGL-based graphic toolkits, this enables a different backend diff -r f8d380d04b01 -r bf05a7c16e9e scripts/plot/util/private/__print_parse_opts__.m --- a/scripts/plot/util/private/__print_parse_opts__.m Thu Jan 17 08:04:53 2019 -0800 +++ b/scripts/plot/util/private/__print_parse_opts__.m Thu Jan 17 09:25:35 2019 +0100 @@ -229,14 +229,28 @@ if (strcmp (arg_st.renderer, "auto")) if (opengl_ok && strcmp (graphics_toolkit (arg_st.figure), "qt")) - arg_st.renderer = "opengl"; + ## "opengl" renderer only does text rotations of 0°, 90°, 180°, 270°, ... + ht = findall (arg_st.figure, "type", "text"); + angles = [get(ht, "rotation"){:}]; + if (any (mod (angles, 90))) + arg_st.renderer = "painters"; + else + arg_st.renderer = "opengl"; + endif else arg_st.renderer = "painters"; endif elseif (strcmp (arg_st.renderer, "opengl") && ! opengl_ok) arg_st.renderer = "painters"; - warning (["print: unsupported output format \"%s\" for renderer ", ... - "\"opengl\"."], arg_st.devopt); + warning (['print: unsupported output format "%s" for renderer ', ... + '"opengl".'], arg_st.devopt); + elseif (! strcmp (graphics_toolkit (arg_st.figure), "qt") + && strcmp (arg_st.renderer, "opengl")) + ## The opengl renderer only works with the "qt" toolkit + arg_st.renderer = "painters"; + warning ('Octave:print:unsupported-renderer', + 'print: "opengl" renderer unsupported for "%s" toolkit', + graphics_toolkit (arg_st.figure)); endif