# HG changeset patch # User jwe # Date 1196817522 0 # Node ID e8a3e3e33490b570754122e7a4fe3f70d2d06825 # Parent be3280acbdb8a3f290f647e8f63cf1d0cf64db2a [project @ 2007-12-05 01:18:41 by jwe] diff --git a/doc/ChangeLog b/doc/ChangeLog --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,16 @@ 2007-12-04 John W. Eaton + * interpreter/sparseimages.m, interpreter/plotimages.m, + interpreter/interpimages.m, interpreter/geometryimages.m: + Set default text font to "*" for png images. + + * interpreter/Makefile.in (run-octave): Don't sleep. + +2007-12-04 Joseph P. Skudlarek + + * interpreter/plotimages.m: Generate text plots. + * interpreter/sparseimages.m: Add initial blank line to text plots. + * interpreter/Makefile.in (IMAGES_TXT): Include $(INTERPIMAGES_TXT) $(GEOMETRYIMAGES_TXT) and $(PLOTIMAGES_TXT) in the list. (INTERPIMAGES_TXT, GEOMETRYIMAGES_TXT, PLOTIMAGES_TXT): New variables. diff --git a/doc/interpreter/Makefile.in b/doc/interpreter/Makefile.in --- a/doc/interpreter/Makefile.in +++ b/doc/interpreter/Makefile.in @@ -245,11 +245,9 @@ fi cp $(filter-out html-dir, $<) HTML -## Sleep for a second after plotting to allow gnuplot to finish -## writing its output before Octave exits. define run-octave $(TOPDIR)/run-octave -f -q -H -p $(srcdir) \ - --eval "$(notdir $(basename $<)) ('$(notdir $(basename $@))', '$(patsubst .%,%, $(suffix $@))'); sleep (1);" + --eval "$(notdir $(basename $<)) ('$(notdir $(basename $@))', '$(patsubst .%,%, $(suffix $@))');" endef $(GEOMETRYIMAGES_EPS) $(GEOMETRYIMAGES_PNG) $(GEOMETRYIMAGES_TXT): geometryimages.m diff --git a/doc/interpreter/geometryimages.m b/doc/interpreter/geometryimages.m --- a/doc/interpreter/geometryimages.m +++ b/doc/interpreter/geometryimages.m @@ -18,6 +18,9 @@ function geometryimages (nm, typ) bury_output (); + if (strcmp (typ, "png")) + set (0, "defaulttextfontname", "*"); + endif if (isempty (findstr (octave_config_info ("DEFS"), "HAVE_QHULL")) && (strcmp (nm, "voronoi") || strcmp (nm, "griddata") || strcmp (nm, "convhull") || strcmp (nm, "delaunay") diff --git a/doc/interpreter/interpimages.m b/doc/interpreter/interpimages.m --- a/doc/interpreter/interpimages.m +++ b/doc/interpreter/interpimages.m @@ -18,6 +18,9 @@ function interpimages (nm, typ) bury_output (); + if (strcmp (typ, "png")) + set (0, "defaulttextfontname", "*"); + endif if (strcmp (nm, "interpft")) t = 0 : 0.3 : pi; dt = t(2)-t(1); n = length (t); k = 100; diff --git a/doc/interpreter/plotimages.m b/doc/interpreter/plotimages.m --- a/doc/interpreter/plotimages.m +++ b/doc/interpreter/plotimages.m @@ -18,6 +18,9 @@ function plotimages (nm, typ) bury_output (); + if (strcmp (typ, "png")) + set (0, "defaulttextfontname", "*"); + endif if (strcmp(typ , "txt")) image_as_txt(nm); elseif (strcmp (nm, "plot")) diff --git a/doc/interpreter/sparseimages.m b/doc/interpreter/sparseimages.m --- a/doc/interpreter/sparseimages.m +++ b/doc/interpreter/sparseimages.m @@ -17,6 +17,9 @@ ## . function sparseimages (nm, typ) + if (strcmp (typ, "png")) + set (0, "defaulttextfontname", "*"); + endif if (! isempty (findstr (octave_config_info ("DEFS"), "HAVE_COLAMD")) && ! isempty (findstr (octave_config_info ("DEFS"), "HAVE_CHOLMOD")) && ! isempty (findstr (octave_config_info ("DEFS"), "HAVE_UMFPACK"))) diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,5 +1,8 @@ 2007-12-04 John W. Eaton + * plot/__go_draw_axes__.m: Omit "font \"NAME,SIZE\"" in gnuplot + text and label commands if font is "*". + * linear-algebra/krylov.m: Doc fixes. From Marco Caliari . diff --git a/scripts/plot/__go_draw_axes__.m b/scripts/plot/__go_draw_axes__.m --- a/scripts/plot/__go_draw_axes__.m +++ b/scripts/plot/__go_draw_axes__.m @@ -74,8 +74,13 @@ else [tt, f, s] = __maybe_munge_text__ (enhanced, t, "string", have_newer_gnuplot); - fprintf (plot_stream, "set title \"%s\" font \"%s,%d\";\n", - undo_string_escapes (tt), f, s); + if (strcmp (f, "*")) + fontspec = ""; + else + fontspec = sprintf ("font \"%s,%d\"", f, s); + endif + fprintf (plot_stream, "set title \"%s\" %s;\n", + undo_string_escapes (tt), fontspec); endif endif @@ -89,12 +94,17 @@ else [tt, f, s] = __maybe_munge_text__ (enhanced, t, "string", have_newer_gnuplot); + if (strcmp (f, "*")) + fontspec = ""; + else + fontspec = sprintf ("font \"%s,%d\"", f, s); + endif if (strcmpi (axis_obj.xaxislocation, "top")) - fprintf (plot_stream, "set x2label \"%s\" %s font \"%s,%d\"", - undo_string_escapes (tt), colorspec, f, s); + fprintf (plot_stream, "set x2label \"%s\" %s %s", + undo_string_escapes (tt), colorspec, fontspec); else - fprintf (plot_stream, "set xlabel \"%s\" %s font \"%s,%d\"", - undo_string_escapes (tt), colorspec, f, s); + fprintf (plot_stream, "set xlabel \"%s\" %s %s", + undo_string_escapes (tt), colorspec, fontspec); endif if (have_newer_gnuplot) ## Rotation of xlabel not yet support by gnuplot as of 4.2, but @@ -120,12 +130,17 @@ else [tt, f, s] = __maybe_munge_text__ (enhanced, t, "string", have_newer_gnuplot); + if (strcmp (f, "*")) + fontspec = ""; + else + fontspec = sprintf ("font \"%s,%d\"", f, s); + endif if (strcmpi (axis_obj.yaxislocation, "right")) - fprintf (plot_stream, "set y2label \"%s\" %s font \"%s,%d\"", - undo_string_escapes (tt), colorspec, f, s); + fprintf (plot_stream, "set y2label \"%s\" %s %s", + undo_string_escapes (tt), colorspec, fontspec); else - fprintf (plot_stream, "set ylabel \"%s\" %s font \"%s,%d\"", - undo_string_escapes (tt), colorspec, f, s); + fprintf (plot_stream, "set ylabel \"%s\" %s %s", + undo_string_escapes (tt), colorspec, fontspec); endif if (have_newer_gnuplot) fprintf (plot_stream, " rotate by %f;\n", angle); @@ -148,8 +163,13 @@ else [tt, f, s] = __maybe_munge_text__ (enhanced, t, "string", have_newer_gnuplot); - fprintf (plot_stream, "set zlabel \"%s\" %s font \"%s,%d\"", - undo_string_escapes (tt), colorspec, f, s); + if (strcmp (f, "*")) + fontspec = ""; + else + fontspec = sprintf ("font \"%s,%d\"", f, s); + endif + fprintf (plot_stream, "set zlabel \"%s\" %s %s", + undo_string_escapes (tt), colorspec, fontspec); if (have_newer_gnuplot) ## Rotation of zlabel not yet support by gnuplot as of 4.2, but ## there is no message about it. @@ -913,6 +933,11 @@ case "text" [label, f, s] = __maybe_munge_text__ (enhanced, obj, "string", have_newer_gnuplot); + if (strcmp (f, "*")) + fontspec = ""; + else + fontspec = sprintf ("font \"%s,%d\"", f, s); + endif lpos = obj.position; halign = obj.horizontalalignment; angle = obj.rotation; @@ -930,14 +955,14 @@ if (nd == 3) fprintf (plot_stream, - "set label \"%s\" at %s %.15g,%.15g,%.15g font \"%s,%d\" %s rotate by %f %s;\n", + "set label \"%s\" at %s %.15g,%.15g,%.15g %s %s rotate by %f %s;\n", undo_string_escapes (label), units, lpos(1), - lpos(2), lpos(3), f, s, halign, angle, colorspec); + lpos(2), lpos(3), fontspec, halign, angle, colorspec); else fprintf (plot_stream, - "set label \"%s\" at %s %.15g,%.15g font \"%s,%d\" %s rotate by %f %s;\n", + "set label \"%s\" at %s %.15g,%.15g %s %s rotate by %f %s;\n", undo_string_escapes (label), units, - lpos(1), lpos(2), f, s, halign, angle, colorspec); + lpos(1), lpos(2), fontspec, halign, angle, colorspec); endif otherwise diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2007-12-04 John W. Eaton + * src/oct-hist.cc (default_history_file): Use += instead of + push_back to append character to std::string object. + * Makefile.in (LIBDLFCN): Delete all uses. * toplev.cc (octave_config_info): Remove LIBDLFCN and diff --git a/src/oct-hist.cc b/src/oct-hist.cc --- a/src/oct-hist.cc +++ b/src/oct-hist.cc @@ -94,7 +94,7 @@ { file = home_dir; if (! file_ops::is_dir_sep (file[file.length()-1])) - file.push_back (file_ops::dir_sep_char); + file += file_ops::dir_sep_char; file.append (".octave_hist"); } else