# HG changeset patch # User Pantxo Diribarne # Date 1552910289 -3600 # Node ID b6ac4615214f85dcf1a3121731d10c69e5682f5f # Parent ef922c0631e7880676d7c7abbc3977ccaa13456f# Parent aa9745a1114adda5db3742cf161bca52f592b671 maint: merge stable to default diff -r ef922c0631e7 -r b6ac4615214f libgui/src/m-editor/file-editor.cc diff -r ef922c0631e7 -r b6ac4615214f scripts/plot/util/print.m --- a/scripts/plot/util/print.m Sun Mar 17 19:13:30 2019 +0800 +++ b/scripts/plot/util/print.m Mon Mar 18 12:58:09 2019 +0100 @@ -1020,22 +1020,36 @@ endfunction -function cmd = pstoedit (opts, devopt) +function cmd = pstoedit (opts, devopt, do_svg = true) if (nargin < 2) devopt = opts.devopt; endif if (isempty (opts.pstoedit_binary)) - error ("print:nopstoedit", "print.m: 'pstoedit' is required for specified output format, but binary is not available in PATH"); + error ("print:nopstoedit", ... + ["print.m: 'pstoedit' is required for specified output format, ", ... + "but binary is not available in PATH"]); endif dos_shell = (ispc () && ! isunix ()); - if (dos_shell) - cmd = sprintf ("%s -f %s 2> NUL", opts.pstoedit_binary, devopt); + + if (! do_svg) + if (dos_shell) + cmd = sprintf ("%s -f %s 2> NUL", opts.pstoedit_binary, devopt); + else + cmd = sprintf ("%s -f %s 2> /dev/null", opts.pstoedit_binary, devopt); + endi;f + endif else - ## FIXME: Is this the right thing to do for DOS? - cmd = sprintf ("%s -f %s 2> /dev/null", opts.pstoedit_binary, devopt); + cmd = svgconvert (opts, devopt); + if (dos_shell) + cmd = sprintf ("%s & %s -ssp -f %s %%s 2> NUL", cmd, ... + opts.pstoedit_binary, devopt); + else + cmd = sprintf ("%s ; %s -ssp -f %s %%s 2> /dev/null", cmd, ... + opts.pstoedit_binary, devopt); + endif endif if (opts.debug) diff -r ef922c0631e7 -r b6ac4615214f scripts/plot/util/private/__opengl_print__.m --- a/scripts/plot/util/private/__opengl_print__.m Sun Mar 17 19:13:30 2019 +0800 +++ b/scripts/plot/util/private/__opengl_print__.m Mon Mar 18 12:58:09 2019 +0100 @@ -88,9 +88,9 @@ pipeline = {sprintf("cat > %s", opts.name)}; endif case fig2dev_devices - cmd_pstoedit = opts.pstoedit_cmd (opts, "fig"); cmd_fig2dev = opts.fig2dev_cmd (opts, opts.devopt); if (strcmp (opts.devopt, "pstex")) + cmd_pstoedit = opts.pstoedit_cmd (opts, "fig", false); [~, ~, ext] = fileparts (opts.name); if (any (strcmpi (ext, {".ps", ".tex", "."}))) opts.name = opts.name(1:end-numel(ext)); @@ -104,17 +104,26 @@ pipeline{2} = sprintf ("%s | %s > %s", cmd_pstoedit, cmd_fig2dev, strrep(opts.name, ".ps", ".tex")); else + ## Using svgconvert + tmp = tempname (); + opts.unlink = [opts.unlink tmp]; + cmd_pstoedit = sprintf (opts.pstoedit_cmd (opts, "fig"), ... + "pdf", tmp, tmp); cmd = sprintf ("%s | %s > %s", cmd_pstoedit, cmd_fig2dev, opts.name); - gl2ps_device = {"eps"}; + gl2ps_device = {"svg"}; pipeline = {cmd}; endif case "aifm" - cmd = opts.pstoedit_cmd (opts, "ps2ai"); - gl2ps_device = {"eps"}; + tmp = tempname (); + opts.unlink = [opts.unlink tmp]; + cmd = sprintf (opts.pstoedit_cmd (opts, "ps2ai"), "pdf", tmp, tmp); + gl2ps_device = {"svg"}; pipeline = {sprintf("%s > %s", cmd, opts.name)}; case {"dxf", "emf", "fig", "hpgl"} - cmd = opts.pstoedit_cmd (opts); - gl2ps_device = {"eps"}; + tmp = tempname (); + opts.unlink = [opts.unlink tmp]; + cmd = sprintf (opts.pstoedit_cmd (opts), "pdf", tmp, tmp); + gl2ps_device = {"svg"}; pipeline = {sprintf("%s > %s", cmd, opts.name)}; case {"corel", "gif"} error ("print:unsupporteddevice",