octave-maintainers
[Top][All Lists]
Advanced

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

Re: gnuplot font specification - was -> [changeset] print.m (matlab comp


From: Ben Abbott
Subject: Re: gnuplot font specification - was -> [changeset] print.m (matlab compatibility)
Date: Mon, 16 Mar 2009 01:10:03 +0800


On Mar 10, 2009, at 12:02 PM, John W. Eaton wrote:

On 10-Mar-2009, Ben Abbott wrote:

| Does the attached find a font that works with the png terminal on our
| system?

No.  But is it something we can fix in Octave?  I think it is just
that gnuplot on my system doesn't know where to find fonts.  I can
probably work around it by setting GDFONTPATH, but should every user
have to do that?  Especially on systems like Debian where there are
packages.  OTOH, running gnuplot and generating a png file with some
labels works when I don't explicitly set any font.  So if Octave's
default font is "*", can we just skip passing a font name to gnuplot?
Will that work?

jwe

John/others,

For most gnuplot terminals I am able to determine the default fontname specification for gnuplot. This is done by setting the gnuplot terminal, obtaining the GPVAL_TERMOPTIONS, and extracting the default fontname.

gnuplot> set term pdf
Terminal type set to 'pdf'
Options are ' noenhanced fname 'Helvetica'  fsize 6 linewidth 1.0  '
gnuplot> show var GPVAL_TERMOPTIONS

        Variables beginning with GPVAL_TERMOPTIONS:
GPVAL_TERMOPTIONS = " noenhanced fname 'Helvetica' fsize 6 linewidth 1.0 "

This works for svg, png, pdf, postscript, fig, eps, and others.

Those which it does not are dxf, hpgl, epslatex, pstex, x11, wxt, etc.

I'll prepare a changeset which will look for fontname = "*" and replace it with the gnuplot default. This will allow the fontsize to be specified for most terminals. For x11, wxt, epslatex, and pstex, gnuplot is happy with the font specification "*,10", so there is no need to replace the "*" in this case (thus fontsize my be included here as well). Terminals like dxf and hpgl do not allow for font specifications (although hpgl can be replaced by pcl5, which is an hpgl-2 terminal driver).

This appears to me to be a nice compromise for gnuplot and the 3.2 release.

Once I have a changeset complete, I'll try all the drivers and determine which ones do not support the specification of font size.

Ben








reply via email to

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