Font problem with png terminal 2.9.17+

John W. Eaton jwe at bevo.che.wisc.edu
Tue Dec 4 19:18:04 CST 2007


On  4-Dec-2007, dbateman wrote:

| Fredrik Lingvall wrote:
| > 
| > 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
| > 
| 
| Ok, I couldn't check the png terminal on my rough gnuplot 4.2.2
| installation. I suppose that in fact the best way to deal with this is to
| have a fontname "default" and don't try to set the fontname at all if the
| fontname is "default". However this might cause issues with the TeX
| \fontname option, but I think we can live with that

OK, I see this problem also bites us when generating png files for the
HTML manual.  I think the following patch does what you propose above,
except it uses "*" instead of "default" to specify the default font.
If you think "default" is better, then it is easy enough to change.

Unfortunately, we still have the following problem:

  ../../run-octave -f -q -H -p /home/jwe/src/octave-trunk/doc/interpreter --eval "plotimages ('extended', 'png');"
  gdImageStringFT: Could not find/open font while printing string ¬ with font Symbol
  gdImageStringFT: Could not find/open font while printing string  x =  with font 
  gdImageStringFT: Could not find/open font while printing string 2/ with font 
  gdImageStringFT: Could not find/open font while printing string Ö with font Symbol
  gdImageStringFT: Could not find/open font while printing string p with font Symbol
  gdImageStringFT: Could not find/open font while printing string   with font 
  gdImageStringFT: Could not find/open font while printing string ò with font Symbol
  gdImageStringFT: Could not find/open font while printing string 0 with font 
  gdImageStringFT: Could not find/open font while printing string x with font 
  gdImageStringFT: Could not find/open font while printing string  e with font 
  gdImageStringFT: Could not find/open font while printing string -t with font 
  gdImageStringFT: Could not find/open font while printing string 2 with font 
  gdImageStringFT: Could not find/open font while printing string  dt with font 
  gdImageStringFT: Could not find/open font while printing string  = 0.6175 with font 

We could avoid this problem by not including "png" in the list of
"enhanced" terminals, but I'm not sure that is the best solution.  If
there is a symbol font that can be used with gnuplot's png terminal,
then I would simply use it.  If this is possible, will someone please
explain how to do it? 

I think we should leave the default fontname property value
"Helvetica".  It is easy enough to globally change the default
property for all figures using

  set (0, "defaulttextfontname", "*");

in your ~/.octaverc file.

jwe


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
Url: https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20071204/a94b71f6/attachment-0001.ksh 


More information about the Octave-maintainers mailing list