octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

default fontname graphics property


From: John W. Eaton
Subject: default fontname graphics property
Date: Sat, 7 Mar 2009 17:04:35 -0500

The default of "Helvetica" seems to cause a lot of trouble.  For
example, many people report problems when trying to generate png files
with gnuplot.  I only chose "Helvetica" because that's the default in
Matlab and I thought people would expect that.  But since it causes so
much trouble, maybe we should switch it to "*", which in Octave means
"use the default font".  If the gnuplot backend sees "*" for the font
name, it just skips trying to set an explicit name and gnuplot uses
its default.  Does anyone see a good reason not to make this change?

Thanks,

jwe

# HG changeset patch
# User John W. Eaton <address@hidden>
# Date 1236463200 18000
# Node ID cde67e7baff969f45c34a1e546bec2bb3489abc6
# Parent  92dd386f0f133804d9835c98421e4758b3b92c74
make default fontname * instead of Helvetica

diff --git a/src/ChangeLog b/src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2009-03-07  John W. Eaton  <address@hidden>
+
+       * graphics.h.in (OCTAVE_DEFAULT_FONTNAME): New macro, defaults to "*".
+       (axes::properties, text::properties): Use it to set default fontname.
+       * graphics.cc (axes::properties::set_defaults): Likewise.
+
 2009-03-07  Jaroslav Hajek  <address@hidden>
 
        * xdiv.cc (mdm_div_impl, dmm_lelftdiv_impl, dmdm_div_impl,
diff --git a/src/graphics.cc b/src/graphics.cc
--- a/src/graphics.cc
+++ b/src/graphics.cc
@@ -2536,7 +2536,7 @@
   if (mode != "replace")
     {
       fontangle = "normal";
-      fontname = "Helvetica";
+      fontname = OCTAVE_DEFAULT_FONTNAME;
       fontsize = 12;
       fontunits = "points";
       fontweight = "normal";
diff --git a/src/graphics.h.in b/src/graphics.h.in
--- a/src/graphics.h.in
+++ b/src/graphics.h.in
@@ -40,6 +40,13 @@
 #include "oct-mutex.h"
 #include "ov.h"
 
+// FIXME -- maybe this should be a configure option?
+// Matlab defaults to "Helvetica", but that causes problems for many
+// gnuplot users.
+#if !defined (OCTAVE_DEFAULT_FONTNAME)
+#define OCTAVE_DEFAULT_FONTNAME "*"
+#endif
+
 class caseless_str : public std::string
 {
 public:
@@ -2686,7 +2693,7 @@
       array_property currentpoint , Matrix (2, 3, 0.0)
       radio_property drawmode , "{normal}|fast"
       radio_property fontangle , "{normal}|italic|oblique"
-      string_property fontname , "Helvetica"
+      string_property fontname , OCTAVE_DEFAULT_FONTNAME
       double_property fontsize , 12
       radio_property fontunits , 
"{points}|normalized|inches|centimeters|pixels"
       radio_property fontweight , "{normal}|light|demi|bold"
@@ -2966,7 +2973,7 @@
       double_property rotation , 0
       radio_property horizontalalignment , "{left}|center|right"
       color_property color , color_values (0, 0, 0)
-      string_property fontname , "Helvetica"
+      string_property fontname , OCTAVE_DEFAULT_FONTNAME
       double_property fontsize , 10
       radio_property fontangle , "{normal}|italic|oblique"
       radio_property fontweight , "light|{normal}|demi|bold"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]