Albrecht Schlosser wrote:
> On 20.10.2010, at 08:55, Duncan Gibson wrote:
> 
>>> OTOH, if you call fl_draw() and didn't set a font before calling
>>> it, then we could probably set a default font ...
>> I think the simplest would be to have an assert or other check that
>> a font has been set, so that the user isn't left scratching his/her
>> head wondering why there's a segmentation fault.
> 
> Yes, I think that we should do at least some fundamental checks to
> prevent a crash, but I'd prefer to set a default font, as it seems
> to be done for some platforms. But it's definitive dependent on the
> platform and configuration (e.g. XFT). We need to check all
> platforms.

        I recall the issue of crashing is long standing in FLTK
        if fl_draw() is called without any previous call to fl_font()..
        it's not a recent problem. I remember when I was first learning
        FLTK, I ran into this too.

        A default font (eg. HELVETICA) would maybe be OK
        if it only gets triggered when fl_draw() is called
        the first time, and fl_font() has not yet been set.

        Definitely avoid setting the font unconditionally on
        FLTK init, as font setting is sometimes a very slow operation.

        
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to