exporting patch:
# HG changeset patch
# User Daniel J Sebald <daniel.sebald@ieee.org>
# Date 1524596910 18000
#      Tue Apr 24 14:08:30 2018 -0500
# Node ID 08657c111202243d80326041f8293db9e73e135e
# Parent  5ca8abb276444ebf78080699975525b40ce713c9
Use consistent gnuplot toolkit font syntax allow SVG fractional font size (bug #53737)

* print.m: Document the cgm and eepic terminals (gnuplot only).

* __gnuplot_print__.m: Condition "background" option on several of the terminal
  types which otherwise would produce a gnuplot warning.  Add terminal type
  cases "cgm" and "latex" to the list of generic plotting formats.
  (font_spec): Use the 'font "<name>,<size>"' format in almost all cases, which
  has been made more consistent in recent gnuplot versions.  Remove code that
  rounds the SVG font size.

* __print_parse_opts__.m: Add to the dev_list "canvas", "cgm", "latex" and
  "eepic" and correspondingly to the suffixes "js", "cgm", "tex" and "tex".

diff --git a/scripts/plot/util/print.m b/scripts/plot/util/print.m
--- a/scripts/plot/util/print.m
+++ b/scripts/plot/util/print.m
@@ -151,6 +151,10 @@
 ##   @itemx @nospell{corel}
 ##     @nospell{CorelDraw}
 ##
+##   @item  cgm
+##     Computer Graphics Metafile, Version 1, ANSI X3.122-1986
+## (only available for the Gnuplot graphics toolkit).
+##
 ##   @item dxf
 ##     AutoCAD
 ##
@@ -165,7 +169,8 @@
 ## (default is @option{-textnormal})
 ##
 ##   @item gif
-##     GIF image (only available for the Gnuplot graphics toolkit)
+##     GIF image
+## (only available for the Gnuplot graphics toolkit).
 ##
 ##   @item hpgl
 ##     HP plotter language
@@ -175,8 +180,9 @@
 ##     JPEG image
 ##
 ##   @item latex
-##     @LaTeX{} picture environment (only available for the Gnuplot graphics
-## toolkit).
+##   @itemx eepic
+##     @LaTeX{} picture environment and extended picture environment
+## (only available for the Gnuplot graphics toolkit).
 ##
 ##   @item mf
 ##     Metafont
diff --git a/scripts/plot/util/private/__gnuplot_print__.m b/scripts/plot/util/private/__gnuplot_print__.m
--- a/scripts/plot/util/private/__gnuplot_print__.m
+++ b/scripts/plot/util/private/__gnuplot_print__.m
@@ -45,12 +45,15 @@ function opts = __gnuplot_print__ (opts)
   ## The axes-label and tick-label spacing is determined by
   ## the font spec given in "set terminal ..."
   gp_opts = font_spec (opts);
-  bg = get (opts.figure, "color");
-  if (isnumeric (bg))
-    gp_opts = sprintf ('%s background rgb "#%02x%02x%02x"',
-                       gp_opts, round (255 * bg));
-  else
-    gp_opts = sprintf ("%s nobackground", gp_opts);
+  if (! any (strcmpi (opts.devopt, {"fig", "dxf", "hpgl", "mf", "pstricks", ...
+                                    "texdraw", "latex", "eepic"})))
+    bg = get (opts.figure, "color");
+    if (isnumeric (bg))
+      gp_opts = sprintf ('%s background rgb "#%02x%02x%02x"',
+                         gp_opts, round (255 * bg));
+    else
+      gp_opts = sprintf ("%s nobackground", gp_opts);
+    endif
   endif
 
   pipeline = "";
@@ -144,7 +147,8 @@ function opts = __gnuplot_print__ (opts)
                "print.m: '%s' output is not available for gnuplot-%s",
                upper (opts.devopt), __gnuplot_version__ ());
       endif
-    case {"canvas", "dxf", "hpgl", "latex", "mf", "gif", "pstricks", "texdraw"}
+    case {"canvas", "cgm", "dxf", "hpgl", "latex", "mf", "gif", ...
+          "pstricks", "texdraw"}
       if (__gnuplot_has_terminal__ (opts.devopt))
         local_drawnow ([opts.devopt " " gp_opts], opts.name, opts);
       else
@@ -246,7 +250,7 @@ function f = font_spec (opts, varargin)
       elseif (! isempty (opts.font))
         f = sprintf ('font "%s"', opts.font);
       elseif (! isempty (opts.fontsize))
-        f = sprintf ("%d", opts.fontsize);
+        f = sprintf ('font ",%d"', opts.fontsize);
       endif
     case {"eps", "eps2", "epsc", "epsc2"}
       ## Gnuplot renders fonts as half their specification, which
@@ -258,19 +262,15 @@ function f = font_spec (opts, varargin)
       elseif (! isempty (opts.font))
         f = sprintf ('font "%s"', opts.font);
       elseif (! isempty (opts.fontsize))
-        f = sprintf ("%d", 2 * opts.fontsize);
+        f = sprintf ('font ",%d"', 2 * opts.fontsize);
       endif
     case "svg"
-      ## FIXME: Why does svg format use round on the fontsize while
-      ##        other terminals don't?
       if (! isempty (opts.font) && ! isempty (opts.fontsize))
-        fontsize = round (opts.fontsize * 0.75);
-        f = sprintf ('fname "%s" fsize %d', opts.font, fontsize);
+        f = sprintf ('font "%s,%d"', opts.font, opts.fontsize * 0.75);
       elseif (! isempty (opts.font))
-        f = sprintf ('fname "%s"', opts.font);
+        f = sprintf ('font "%s"', opts.font);
       elseif (! isempty (opts.fontsize))
-        fontsize = round (opts.fontsize * 0.75);
-        f = sprintf ("fsize %d", fontsize);
+        f = sprintf ('font ",%d"', opts.fontsize * 0.75);
       endif
     case "pdf"
       if (! isempty (opts.font) && ! isempty (opts.fontsize))
@@ -305,7 +305,7 @@ function f = font_spec (opts, varargin)
       endif
     case {"gif", "jpeg", "png"}
       if (! isempty (opts.font) && ! isempty (opts.fontsize))
-        f = sprintf ('font "%s ,%d"', opts.font, opts.fontsize);
+        f = sprintf ('font "%s,%d"', opts.font, opts.fontsize);
       elseif (! isempty (opts.font))
         f = sprintf ('font "%s"', opts.font);
       elseif (! isempty (opts.fontsize))
@@ -313,31 +313,31 @@ function f = font_spec (opts, varargin)
       endif
     case "emf"
       if (! isempty (opts.font) && ! isempty (opts.fontsize))
-        f = sprintf ('"%s" %d', opts.font, opts.fontsize);
+        f = sprintf ('font "%s,%d"', opts.font, opts.fontsize);
       elseif (! isempty (opts.font))
-        f = sprintf ('"%s"', opts.font);
+        f = sprintf ('font "%s"', opts.font);
       elseif (! isempty (opts.fontsize))
-        f = sprintf ("%d", opts.fontsize);
+        f = sprintf ('font ",%d"', opts.fontsize);
       endif
     case "canvas"
       if (! isempty (opts.fontsize))
-        f = sprintf ("fsize %d", opts.fontsize);
+        f = sprintf ('font ",%d"', opts.fontsize);
       endif
     case {"aifm", "corel"}
       if (! isempty (opts.font) && ! isempty (opts.fontsize))
-        f = sprintf ("%s %d", opts.font, opts.fontsize);
+        f = sprintf ('font "%s,%d"', opts.font, opts.fontsize);
       elseif (! isempty (opts.font))
-        f = sprintf ("%s", opts.font);
+        f = sprintf ('font "%s"', opts.font);
       elseif (! isempty (opts.fontsize))
-        f = sprintf ("%d", opts.fontsize);
+        f = sprintf ('font ",%d"', opts.fontsize);
       endif
     case "fig"
       if (! isempty (opts.font) && ! isempty (opts.fontsize))
-        f = sprintf ("font %s fontsize %d", opts.font, opts.fontsize);
+        f = sprintf ('font "%s,%d"', opts.font, opts.fontsize);
       elseif (! isempty (opts.font))
-        f = sprintf ("font %s", opts.font);
+        f = sprintf ('font "%s"', opts.font);
       elseif (! isempty (opts.fontsize))
-        f = sprintf ("fontsize %d", opts.fontsize);
+        f = sprintf ('font ",%d"', opts.fontsize);
       endif
   endswitch
 
diff --git a/scripts/plot/util/private/__print_parse_opts__.m b/scripts/plot/util/private/__print_parse_opts__.m
--- a/scripts/plot/util/private/__print_parse_opts__.m
+++ b/scripts/plot/util/private/__print_parse_opts__.m
@@ -225,7 +225,8 @@ function arg_st = __print_parse_opts__ (
               "epscairo", "pdfcairo", "pngcairo", "cairolatex", ...
               "pdfcairolatex", "pdfcairolatexstandalone", ...
               "epscairolatex", "epscairolatexstandalone", "pstricks", ...
-              "epswrite", "eps2write", "pswrite", "ps2write", "pdfwrite"};
+              "epswrite", "eps2write", "pswrite", "ps2write", "pdfwrite", ...
+              "canvas", "cgm", "latex", "eepic"};
 
   persistent suffixes = {"ai", "cdr", "fig", "png", "jpg", ...
               "gif", "pbm", "pbm", "dxf", "mf", ...
@@ -239,7 +240,8 @@ function arg_st = __print_parse_opts__ (
               "eps", "pdf", "png", "tex", ...
               "tex", "tex", ...
               "tex", "tex", "tex", ...
-              "eps", "eps", "ps", "ps", "pdf"};
+              "eps", "eps", "ps", "ps", "pdf", ...
+              "js", "cgm", "tex", "tex"};
 
   if (isfigure (arg_st.figure))
     __graphics_toolkit__ = get (arg_st.figure, "__graphics_toolkit__");
