|
From: Manfred S. <man...@gm...> - 2009-04-15 22:53:38
|
> On Monday 13 April 2009 09:10:23 Pierre Joye wrote:
> > On Mon, Apr 13, 2009 at 5:56 PM, Ethan Merritt
> <merritt@u.washington.edu> wrote:
> >> Is it true that libgd now looks for fontconfig?
> > no, only if you tell it to do so.
>
> I now see that Mojca has pointed out the function gdFTUseFontConfig(),
> which I did not know about. This looks very promising, and I think we
> should
> use it to try both the old (GDFONTPATH) and new (fontconfig) mechanisms
> when
> looking for a user-specified font.
>
> However, I coded up a quick test patch for gnuplot's gd driver and ran
> into
> the following problem. Perhaps I am doing something wrong:
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> /* First try the old GDFONTPATH mechanism for locating fonts */
> gdFTUseFontConfig(0);
> err = gdImageStringFT(NULL, &brect[0], 0,
> png_state.ttffont, (double)png_state.default_ttfsize,
> 0.0, 0, 0, "test");
>
> /* If that didn't work, try again using fontconfig mechanism */
> if (err && gdFTUseFontConfig(1)) {
> err = gdImageStringFT(NULL, &brect[0], 0,
> png_state.ttffont, (double)png_state.default_ttfsize,
> 0.0, 0, 0, "test");
> fprintf(stderr,"fontconfig %s font %s\n",
> err ? "did not find" : "found",
> png_state.ttffont);
> }
>
> /* If we still haven't found the font, punt to the internal
> non-TTF default set */
> if (err) {
> fprintf(stderr,"%s when opening font \"%s\", using internal
> non-scalable font\n",
> err, png_state.ttffont);
> }
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
Sorry to spoil the party -
Does this mean, not even the ugly work-around to set
GDFONTPATH=/dev/null to get the builtin fixed fonts of libgd
will work any more?
I really would like to have a possibility to use the builtin fonts.
The simplest thing would be to treat the libgd font names special?
I.e. if the the font name is one of
"tiny","small","medium","large","giant" treat them special,
skip font lookup and directly use the respective libgd builtin fonts?
I.e. the use would then be as
...
set term png font "small"
...
Would be great!
Cheers,
Manfred
--
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger01
|