#149 'set terminal png small' still generates warning

closed
nobody
None
5
2012-11-23
2012-10-09
hugh williams
No

From the documentation, I understand that if there's not a proper font available, the png terminal type will generate a warning like

Could not find/open font when opening font "arial", using internal non-scalable font

The documentation further states that there are 5 "default", non-scalable fonts available to the png terminal type:

Five basic fonts are supported directly by the gd library. These are tiny (5x8 pixels), small (6x12 pixels), medium, (7x13 Bold), large (8x16) or giant (9x15 pixels). These fonts cannot be scaled or rotated (pure horizontal or vertical text only).

I have the following configuration (and yes, I understand that this is not the latest gnuplot, but it is what Redhat currently delivers):

#######################################
$ uname -a
Linux ofweb2 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/redhat\-release
Red Hat Enterprise Linux Server release 6.2 (Santiago)

$ rpm -qa | grep -e ^gd- -e ^gnuplot
gd-devel-2.0.35-10.el6.x86_64
gd-2.0.35-10.el6.x86_64
gnuplot-common-4.2.6-2.el6.x86_64
gnuplot-4.2.6-2.el6.x86_64

$ gnuplot

G N U P L O T
Version 4.2 patchlevel 6
last modified Sep 2009
System: Linux 2.6.32-220.el6.x86_64

Copyright (C) 1986 - 1993, 1998, 2004, 2007 - 2009
Thomas Williams, Colin Kelley and many others

Type `help` to access the on-line reference manual.
The gnuplot FAQ is available from http://www.gnuplot.info/faq/

Send bug reports and suggestions to <http://sourceforge.net/projects/gnuplot>

Terminal type set to 'x11'
gnuplot> show version long

G N U P L O T
Version 4.2 patchlevel 6
last modified Sep 2009
System: Linux 2.6.32-220.el6.x86_64

Copyright (C) 1986 - 1993, 1998, 2004, 2007 - 2009
Thomas Williams, Colin Kelley and many others

Type `help` to access the on-line reference manual.
The gnuplot FAQ is available from http://www.gnuplot.info/faq/

Send bug reports and suggestions to <http://sourceforge.net/projects/gnuplot>

Compile options:
-READLINE +LIBREADLINE +HISTORY +BACKWARDS_COMPATIBILITY +BINARY_DATA
+GD_PNG +GD_JPEG +GD_TTF +GD_GIF +ANIMATION
-NOCWDRC +X11 +X11_POLYGON +MULTIBYTE +USE_MOUSE +HIDDEN3D_QUADTREE
+DATASTRINGS +HISTOGRAMS +OBJECTS +STRINGVARS +MACROS +IMAGE

DRIVER_DIR = "/usr/libexec/gnuplot/4.2"
GNUPLOT_PS_DIR = "/usr/share/gnuplot/4.2/PostScript"
HELPFILE = "/usr/share/gnuplot/4.2/gnuplot.gih"

#######################################

But when I try to set a png terminal and use one of the defaults, I get a warning:

gnuplot> set term png small
Terminal type set to 'png'
Could not find/open font when opening font "arial", using internal non-scalable font
Options are 'nocrop small '

I do not have GNUPLOT_DEFAULT_GDFONT or GDFONTPATH environment variables set. Why is the 'set term' command telling me about a missing arial font when I am not trying to use one?

Discussion

  • Ethan Merritt
    Ethan Merritt
    2012-10-10

    Your gnuplot was built with support for TrueType fonts (+GD_TTF), so it assumes that is what you want to use. You didn't specify a font, so it tries "arial" as a commonly available default. libgd doesn't find it. So then it falls back to the built-in bitmap font set. I am guessing that you expected "small" to select one of the builtin fonts, but gnuplot version 4.2 interpreted it as a font size command (10 pt IIRC) and so tried "arial,10".

    Newer gnuplot versions behave more like you expect, interpreting "small" with no font name given as an explicit request for a builtin font.

     
  • Ethan Merritt
    Ethan Merritt
    2012-11-23

    • status: open --> closed