gd.trm png_state.default_font

View: New views
3 Messages — Rating Filter:   Alert me  

gd.trm png_state.default_font

by Tait :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Here's a transcript from a recent CVS:

        Terminal type set to 'windows'
        gnuplot> set term png
        Terminal type set to 'png'
        Options are 'nocrop font arial 12 size 640,480 '
        gnuplot> set term windows
        Terminal type set to 'windows'
        Options are 'color noenhanced'
        gnuplot> set term png
        Terminal type set to 'png'
        gd.trm: caught initialization error
        Options are 'nocrop font arial 12 size 640,480 '
        gnuplot> set term windows
        Terminal type set to 'windows'
        Options are 'color noenhanced'
        gnuplot> set term png
        Terminal type set to 'png'
        Options are 'nocrop font arial 12 size 640,480 '
        gnuplot> set output 'sinx.png'
        gnuplot> plot sin(x)
        gnuplot> unset output
        gnuplot> set term windows enhanced
        Terminal type set to 'windows'
        Options are 'color enhanced'
        gnuplot>


If I attempt to plot after the _first_ "set term png" gnuplot will crash,
every time. If I wait until after the "caught initialization" error as
above, plotting works fine -- valid PNG results and no crash. (There are
certain combinations of options I can give to the PNG terminal to avoid
this crash, but I haven't narrowed down exactly what they are.)

The initialization error seems to come from term/gd.trm when it discovers
the default_font pointer is NULL. A FIXME comment just above this
suggests it should "never happen," from which I surmise this isn't a
known problem. If I force GD_NEED_LOCAL_FONT_POINTERS to be undefined,
the gd.trm initialization error goes away and so does the crashing. I'm
not sure what else, if anything, this breaks.

What does GD_NEED_LOCAL_FONT_POINTERS do? How are font pointers used
and what does it mean for one to be local?

Tait


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: gd.trm png_state.default_font

by Ethan Merritt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 30 October 2009 05:57:02 Tait wrote:

>
> Here's a transcript from a recent CVS:
>
> Terminal type set to 'windows'
> gnuplot> set term png
> Terminal type set to 'png'
> Options are 'nocrop font arial 12 size 640,480 '
> gnuplot> set term windows
> Terminal type set to 'windows'
> Options are 'color noenhanced'
> gnuplot> set term png
> Terminal type set to 'png'
> gd.trm: caught initialization error
> Options are 'nocrop font arial 12 size 640,480 '

> The initialization error seems to come from term/gd.trm when it discovers
> the default_font pointer is NULL. A FIXME comment just above this
> suggests it should "never happen," from which I surmise this isn't a
> known problem. If I force GD_NEED_LOCAL_FONT_POINTERS to be undefined,
> the gd.trm initialization error goes away and so does the crashing. I'm
> not sure what else, if anything, this breaks.
>
> What does GD_NEED_LOCAL_FONT_POINTERS do? How are font pointers used
> and what does it mean for one to be local?

This has to do with linking to a particular windows version of libgd.  
Apparently when building a shared libgd.dll for windows,
there are two different ways to define font pointers.  The conditional
flag GD_NEED_LOCAL_FONT_POINTERS in gnuplot is supposed to signal which
of these two methods the Windows *.dll is using.  My guess is that your
copy of libgd.dll uses one method, while your copy of gnuplot assumes
the other. But that's only a guess. I don't work with Windows, and I'm
hazy on the details.    

On the other hand, these pointers are only used if the terminal falls
back to using a default internal font.  Since you are requesting a specific
external font  "Arial,12", I don't immediately see why this error
would trigger.  If you can trap a specific source code line number at
which the crash triggers, that might help.


--
Ethan A Merritt

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: gd.trm png_state.default_font

by Petr Mikulik :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Here's a transcript from a recent CVS:
>
> Terminal type set to 'windows'
> gnuplot> set term png
> Terminal type set to 'png'
> Options are 'nocrop font arial 12 size 640,480 '
> gnuplot> set term windows
> Terminal type set to 'windows'
> Options are 'color noenhanced'
> gnuplot> set term png
> Terminal type set to 'png'
> gd.trm: caught initialization error
>
> If I attempt to plot after the _first_ "set term png" gnuplot will crash,
> every time. If I wait until after the "caught initialization" error as
> above, plotting works fine -- valid PNG results and no crash. (There are
> certain combinations of options I can give to the PNG terminal to avoid
> this crash, but I haven't narrowed down exactly what they are.)

I've compiled gnuplot with static gd library and it works correctly.

---
PM

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta