font problem with PostScript print

John W. Eaton jwe at bevo.che.wisc.edu
Mon Mar 3 19:21:56 CST 2008


On  3-Mar-2008, Larry Doolittle wrote:

| I'm gradually getting used to octave-3.0, after years with 2.x.
| Some things are better, some are "worse", but the compatibility
| with colleagues who use Matlab is obviously good.

What's "worse"?

| I had horrible problems today getting usable PostScript plots
| out of it.  The default font for xlabel, ylabel, and title appears
| to be "helvetica", which does not exist on my system.  I have
| "Helvetica", which is still used for labeling tick marks.
| The unknown font either causes a crash in converting to pdf, or
| some default typewriter font getting used as a fallback.
| 
| The origin of the problem appears to be the get_fontname_and_size
| routine inside __go_draw_axes__.m.  It says
|   if (isempty (t.fontname))
|     fnt = "helvetica";
|   else
|     fnt = tolower (t.fontname);
|   endif
| I can confirm that a lowercase helvetica ends up on the gnuplot
| command pipe, and that attempting to override the default
| (title('Testing','fontname','Helvetica')) doesn't work because
| of the tolower() call.  In fact, some other part of the program
| sets a default "Helvetica", so the isempty() case above is not
| normally used.

This problem has been reported and fixed:

  http://velveeta.che.wisc.edu/cgi-bin/hgwebdir.cgi/octave/rev/71209cfdaebe

You will still need to tell gnuplot how to find this font.  There has
been some discussion about this topic, for example in this thread:

  https://www.cae.wisc.edu/pipermail/bug-octave/2008-March/005266.html

In addition to fixing __go_draw_axes__.m, you can also select a
different default font (for example Arial), using

  set (0, 'defaulttextfontname', 'Arial')

jwe


More information about the Bug-octave mailing list