Font problem with png terminal 2.9.17+

Fredrik Lingvall fl at ifi.uio.no
Tue Dec 4 06:55:15 CST 2007


I have this issue with printing to png files:

octave:1> figure(1)
octave:2> plot(randn(100,1))
octave:3> xlabel('x')
octave:4> print -dpng test.png
gdImageStringFT: Could not find/open font while printing string x with 
font helvetica

Using gnuplot directly I get this:
gnuplot> set terminal png font helvetica
Terminal type set to 'png'
Could not find/open font when opening font helvetica, using default
Options are 'nocrop medium size 640,480 '

After some googling I found out that  one can set the variable 
GDFONTPATH to point
to the TrueType fonts but I have no (and can't find) helvetica.ttf font 
file on my (up-to-date)
Gentoo system.

ls /usr/share/fonts/corefonts/ gives:

andalemo.ttf  comic.ttf    encodings.dir  georgiaz.ttf  trebuc.ttf    
verdanai.ttf
arial.ttf     comicbd.ttf  fonts.dir      impact.ttf    trebucbd.ttf  
verdanaz.ttf
arialbd.ttf   cour.ttf     fonts.scale    times.ttf     trebucbi.ttf  
webdings.ttf
arialbi.ttf   courbd.ttf   georgia.ttf    timesbd.ttf   trebucit.ttf
ariali.ttf    courbi.ttf   georgiab.ttf   timesbi.ttf   verdana.ttf
ariblk.ttf    couri.ttf    georgiai.ttf   timesi.ttf    verdanab.ttf

so if I do an export GDFONTPATH=/usr/share/fonts/corefonts/ then, for 
example,

gnuplot> set terminal png font arial
Terminal type set to 'png'
Options are 'nocrop font arial 12 size 640,480 '

works fine (but not set terminal png font helvetica).  I'm not sure if 
this is
a Gentoo, octave, gnuplot, or gd problem.

/Fredrik





More information about the Octave-maintainers mailing list