|
From: Ethan A M. <sf...@us...> - 2011-04-12 18:32:23
|
On Tuesday, April 12, 2011 11:06:31 am pl...@pi... wrote:
> On 04/12/11 19:02, Ethan Merritt wrote:
> > On Tuesday, April 12, 2011 01:28:26 am pl...@pi... wrote:
> >> Hi,
> >>
> >> I just tried outputting to png terminal and it failed to find a scalable
> >> font. I have not found out why yet, but I don't recall this error last
> >> time I did this a few months back.
> >
> > Sounds like a problem with libgd.
> > Check your environmental variable GDFONTPATH.
>
> Correct , that is not set but apparently that was not needed a month or
> so ago.
>
> My Xorg.0.log shows this, so clearly the fonts are available.
No. That's a misunderstanding.
libgd doesn't use X11 for anything. It works perfectly well
on a machine with no X font server at all (e.g. Windows).
So the settings in Xorg are not relevant.
> So is this a change in xorg, gdlib or the way I'm using gnuplot?
>
> Exporting GDFONTPATH fixed it but I don't quite see why it is now
> necessary to clutter my env even further .
In versions of libgd through (I think) 2.0.34, the environmental variable
was the only way to control font paths. In 2.0.35 there is a second mechanism
possible, using the fontconfig utility. Shige Takeno added a fallback mechanism
to gnuplot in Sep 2010 such that if no font is found using GDFONTPATH then
it makes a second try using fontconfig. But it's hard to see how that would
explain your case. In principle the difference should be that the new method
has two chances to get it right, whereas before it only had one chance.
Caveat: It's slightly more complicated than that due to a bug in the
released version of libgd 2.0.35/36. If you want to try recompiling libgd,
the patch is here:
--- gd-2.0.36/gdft.c 2008-03-09 16:05:52.000000000 -0700
+++ gd-2.0.36-mod/gdft.c 2009-05-20 20:22:13.000000000 -0700
@@ -1661,7 +1661,7 @@ static char * font_path(char **fontpath,
BGD_DECLARE(int) gdFTUseFontConfig(int flag)
{
#ifdef HAVE_LIBFONTCONFIG
- fontConfigFlag = 1;
+ fontConfigFlag = flag;
return 1;
#else
return 0;
If your copy of libgd came via a linux distribution, it is possible that this
patch has already been applied. It's been circulating for a couple of years.
But really the "normal" way of setting a font path for libgd is GDFONTPATH or,
if you have a development version of libgd (2.0.36+ or 2.1.0) then your can
alternatively use fontconfig.
Ethan
>
> >
> >> gnuplot> load "foo.gnu
> >> Could not find/open font when opening font "arial", using internal
> >> non-scalable font
> >>
> >>
> >> However, the result of this is text misplacement.
> >>
> >> set xtics out nomirror rotate by -45
> >>
> >> Now it seems that 45-rotation is not possible with whatever font it
> >> substituted but what it did output was the tick label going straight
> >> upwards from the origin (close to the tick mark) where the rotated text
> >> would have started.
> >>
> >> There seem to be two problems here.
> >>
> >> 1/ rotate -45 should slope down to the right. Here it IS rotated but +90
> >> , no rotation or -90 would be a better fall-back.
> >>
> >> 2/ if it does rotate up the origin is totally wrong (ie not recalculated
> >> for the actual rotation) and dumps all over the plot area.
> >>
> >>
> >> My guess from the behaviour is that the actual rotation is a bug rather
> >> than a fall-back , or at least a buggy fall-back.
> >
> > The fonts internal to libgd are non-rotatable, although the orientation of
> > the pixel array can be transposed to give +/- 90 degree orientation.
> > Given that rotatable fonts (ttf, otf, pfa, etc) are ubiquitous these days,
> > I don't think it's worth much effort trying to figure out which emergency
> > fallback orientation of a non-rotatable font is least wrong.
> >
> >> This was running std release version 4.2.2
> >
> > If that's not a typo for 4.4.2, you're talking about a ~5 year old version.
> > No further releases in the 4.2 series are likely to happen,
> > so bug reports should be made against 4.4 or 4.5.
>
> Yes , dyslexia rules, K.O !!
>
> regards. Peter.
>
> >
> > Ethan
> >
> >
> >>
> >> regards. Peter.
> >>
>
>
|