f



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

Hello, I have installed gnuplot on our cluster, and am seeing the above message when I try to run the following script.  Can someone please educate me?  :-)  Thanks!

set term png
set output '| display png:-'  # cool trick 
plot sin(x) with lines

Setting the term font does not help: 
set term png font arial 14 size 800,600 

Also, according to https://groups.google.com/forum/?fromgroups#!topic/opentsdb/iVXcPyy5e9I, I should be able to use the liberation fonts, which I have found in usr/share/fonts/liberation

rcook@rzgpu2 (gnuplot): ls /usr/share/fonts/liberation
LiberationMono-Bold.ttf        LiberationSans-Regular.ttf
LiberationMono-BoldItalic.ttf  LiberationSerif-Bold.ttf
LiberationMono-Italic.ttf      LiberationSerif-BoldItalic.ttf
LiberationMono-Regular.ttf     LiberationSerif-Italic.ttf
LiberationSans-Bold.ttf        LiberationSerif-Regular.ttf
LiberationSans-BoldItalic.ttf  fonts.dir
LiberationSans-Italic.ttf      fonts.scale

But when I try setting GDFONTPATH, it still gets the same error: 


rcook@rzgpu2 (gnuplot): export GDFONTPATH=/usr/share/fonts
rcook@rzgpu2 (gnuplot): gnuplot newtest.gnuplot 
Could not find/open font when opening font "arial", using internal non-scalable font

rcook@rzgpu2 (gnuplot): export GDFONTPATH=/usr/share/fonts/liberation
rcook@rzgpu2 (gnuplot): gnuplot newtest.gnuplot 
Could not find/open font when opening font "arial", using internal non-scalable font
0
Rich
6/17/2013 5:39:31 PM
comp.graphics.apps.gnuplot 5008 articles. 0 followers. Post Follow

3 Replies
12537 Views

Similar Articles

[PageSpeed] 34

Rich Cook wrote:

> Hello, I have installed gnuplot on our cluster, and am seeing the above
> message when I try to run the following script.  Can someone please
> educate me?  :-)  Thanks!
> 
> set term png
> set output '| display png:-'  # cool trick
> plot sin(x) with lines
> 
> Setting the term font does not help:
> set term png font arial 14 size 800,600

So you are telling libgd to use a font named arial;
it will add (.ttf) when looking for it.  So in order to satisfy this
request you need to have arial.ttf installed somewhere. 
> 
> Also, according to
> https://groups.google.com/forum/?fromgroups#!topic/opentsdb/iVXcPyy5e9I, I
> should be able to use the liberation fonts, which I have found in
> usr/share/fonts/liberation
> 
> rcook@rzgpu2 (gnuplot): ls /usr/share/fonts/liberation
> LiberationMono-Bold.ttf        LiberationSans-Regular.ttf
> LiberationMono-BoldItalic.ttf  LiberationSerif-Bold.ttf
> LiberationMono-Italic.ttf      LiberationSerif-BoldItalic.ttf
> LiberationMono-Regular.ttf     LiberationSerif-Italic.ttf
> LiberationSans-Bold.ttf        LiberationSerif-Regular.ttf
> LiberationSans-BoldItalic.ttf  fonts.dir
> LiberationSans-Italic.ttf      fonts.scale
> 
> But when I try setting GDFONTPATH, it still gets the same error:
> 
> 
> rcook@rzgpu2 (gnuplot): export GDFONTPATH=/usr/share/fonts
> rcook@rzgpu2 (gnuplot): gnuplot newtest.gnuplot
> Could not find/open font when opening font "arial", using internal
> non-scalable font

Well yes. If you want to use the Liberation fonts then say
   set term png font "LiberationSans-Regular"
or probably better, put it in an environmental variable.  E.g.
   setenv GNUPLOT_DEFAULT_GDFONT LiberationSans-Regular

Or if you think people are going to be requesting arial even though
you don't want to install it, how about
   cd /usr/share/fonts/liberation
   ln -s LiberationSans-Regular.ttf arial.ttf


> rcook@rzgpu2 (gnuplot): export GDFONTPATH=/usr/share/fonts/liberation
> rcook@rzgpu2 (gnuplot): gnuplot newtest.gnuplot
> Could not find/open font when opening font "arial", using internal
> non-scalable font

0
sfeam
6/18/2013 12:05:14 AM
On Monday, June 17, 2013 5:05:14 PM UTC-7, sfeam wrote:
> Rich Cook wrote:
>=20
>=20
>=20
> > Hello, I have installed gnuplot on our cluster, and am seeing the above
>=20
> > message when I try to run the following script.  Can someone please
>=20
> > educate me?  :-)  Thanks!
>=20
> >=20
>=20
> > set term png
>=20
> > set output '| display png:-'  # cool trick
>=20
> > plot sin(x) with lines
>=20
> >=20
>=20
> > Setting the term font does not help:
>=20
> > set term png font arial 14 size 800,600
>=20
>=20
>=20
> So you are telling libgd to use a font named arial;
>=20
> it will add (.ttf) when looking for it.  So in order to satisfy this
>=20
> request you need to have arial.ttf installed somewhere.=20
>=20
> >=20
>=20
> > Also, according to
>=20
> > https://groups.google.com/forum/?fromgroups#!topic/opentsdb/iVXcPyy5e9I=
, I
>=20
> > should be able to use the liberation fonts, which I have found in
>=20
> > usr/share/fonts/liberation
>=20
> >=20
>=20
> > rcook@rzgpu2 (gnuplot): ls /usr/share/fonts/liberation
>=20
> > LiberationMono-Bold.ttf        LiberationSans-Regular.ttf
>=20
> > LiberationMono-BoldItalic.ttf  LiberationSerif-Bold.ttf
>=20
> > LiberationMono-Italic.ttf      LiberationSerif-BoldItalic.ttf
>=20
> > LiberationMono-Regular.ttf     LiberationSerif-Italic.ttf
>=20
> > LiberationSans-Bold.ttf        LiberationSerif-Regular.ttf
>=20
> > LiberationSans-BoldItalic.ttf  fonts.dir
>=20
> > LiberationSans-Italic.ttf      fonts.scale
>=20
> >=20
>=20
> > But when I try setting GDFONTPATH, it still gets the same error:
>=20
> >=20
>=20
> >=20
>=20
> > rcook@rzgpu2 (gnuplot): export GDFONTPATH=3D/usr/share/fonts
>=20
> > rcook@rzgpu2 (gnuplot): gnuplot newtest.gnuplot
>=20
> > Could not find/open font when opening font "arial", using internal
>=20
> > non-scalable font
>=20
>=20
>=20
> Well yes. If you want to use the Liberation fonts then say
>=20
>    set term png font "LiberationSans-Regular"
>=20
> or probably better, put it in an environmental variable.  E.g.
>=20
>    setenv GNUPLOT_DEFAULT_GDFONT LiberationSans-Regular
>=20
>=20
>=20
> Or if you think people are going to be requesting arial even though
>=20
> you don't want to install it, how about
>=20
>    cd /usr/share/fonts/liberation
>=20
>    ln -s LiberationSans-Regular.ttf arial.ttf
>=20
>=20
>=20
>=20
>=20
> > rcook@rzgpu2 (gnuplot): export GDFONTPATH=3D/usr/share/fonts/liberation
>=20
> > rcook@rzgpu2 (gnuplot): gnuplot newtest.gnuplot
>=20
> > Could not find/open font when opening font "arial", using internal
>=20
> > non-scalable font

It's not that I want to be able to use arial, it's that I'm getting the abo=
ve message just by trying to make a simple plot with PNG terminal.  If I us=
e pngcairo, then there is no error message.   If you notice, the first scri=
pt I posted says nothing about fonts at all. Yet it gives the "cannot find =
arial" message. =20
What is the source of the error? 
0
Rich
6/19/2013 3:36:46 AM
Rich Cook wrote:

> On Monday, June 17, 2013 5:05:14 PM UTC-7, sfeam wrote:
>> Rich Cook wrote:
>> 
>> 
>> 
>> > Hello, I have installed gnuplot on our cluster, and am seeing the
>> > above
>> 
>> > message when I try to run the following script.  Can someone please
>> 
>> > educate me?  :-)  Thanks!
>> 
>> > 
>> 
>> > set term png
>> 
>> > set output '| display png:-'  # cool trick
>> 
>> > plot sin(x) with lines
>> 
>> > 
>> 
>> > Setting the term font does not help:
>> 
>> > set term png font arial 14 size 800,600
>> 
>> 
>> 
>> So you are telling libgd to use a font named arial;
>> 
>> it will add (.ttf) when looking for it.  So in order to satisfy this
>> 
>> request you need to have arial.ttf installed somewhere.
>> 
>> > 
>> 
>> > Also, according to
>> 
>> > https://groups.google.com/forum/?fromgroups#!topic/opentsdb/iVXcPyy5e9I,
>> > I
>> 
>> > should be able to use the liberation fonts, which I have found in
>> 
>> > usr/share/fonts/liberation
>> 
>> > 
>> 
>> > rcook@rzgpu2 (gnuplot): ls /usr/share/fonts/liberation
>> 
>> > LiberationMono-Bold.ttf        LiberationSans-Regular.ttf
>> 
>> > LiberationMono-BoldItalic.ttf  LiberationSerif-Bold.ttf
>> 
>> > LiberationMono-Italic.ttf      LiberationSerif-BoldItalic.ttf
>> 
>> > LiberationMono-Regular.ttf     LiberationSerif-Italic.ttf
>> 
>> > LiberationSans-Bold.ttf        LiberationSerif-Regular.ttf
>> 
>> > LiberationSans-BoldItalic.ttf  fonts.dir
>> 
>> > LiberationSans-Italic.ttf      fonts.scale
>> 
>> > 
>> 
>> > But when I try setting GDFONTPATH, it still gets the same error:
>> 
>> > 
>> 
>> > 
>> 
>> > rcook@rzgpu2 (gnuplot): export GDFONTPATH=/usr/share/fonts
>> 
>> > rcook@rzgpu2 (gnuplot): gnuplot newtest.gnuplot
>> 
>> > Could not find/open font when opening font "arial", using internal
>> 
>> > non-scalable font
>> 
>> 
>> 
>> Well yes. If you want to use the Liberation fonts then say
>> 
>>    set term png font "LiberationSans-Regular"
>> 
>> or probably better, put it in an environmental variable.  E.g.
>> 
>>    setenv GNUPLOT_DEFAULT_GDFONT LiberationSans-Regular
>> 
>> 
>> 
>> Or if you think people are going to be requesting arial even though
>> 
>> you don't want to install it, how about
>> 
>>    cd /usr/share/fonts/liberation
>> 
>>    ln -s LiberationSans-Regular.ttf arial.ttf
>> 
>> 
>> 
>> 
>> 
>> > rcook@rzgpu2 (gnuplot): export
>> > GDFONTPATH=/usr/share/fonts/liberation
>> 
>> > rcook@rzgpu2 (gnuplot): gnuplot newtest.gnuplot
>> 
>> > Could not find/open font when opening font "arial", using internal
>> 
>> > non-scalable font
> 
> It's not that I want to be able to use arial, it's that I'm getting
> the above message just by trying to make a simple plot with PNG
> terminal.  If I use pngcairo, then there is no error message.   If you
> notice, the first script I posted says nothing about fonts at all. Yet
> it gives the "cannot find arial" message. What is the source of the
> error?

There has to be some default font.  
If you haven't specified a default font on your system, 
the program still has to pick one. Arial is reasonably common,
or was at the time the decision was made, so we picked that one.
  setenv GNUPLOT_DEFAULT_GDFONT LiberationSans-Regular
would bypass this, since it specifies a different default.

As to png (libgd) vs. pngcairo,  those are completely different
support libraries.  Font handling by one has nothing to do with
font handling by the other.  And PostScript is different yet 
again, and svg, and TeX, and so on and so on.    

0
sfeam
6/19/2013 4:33:47 AM
Reply: