On 10 May 2011, at 13:46, Albrecht Schlosser wrote:

> Okay, I'll be offline for the next hours, too, but I'm curious what
> you may find. Thanks.

OK - I stared at this for a bit, then I noticed that the main difference 
between my test harness and the render_text test is that in my code I render 
the string (i.e. I call fl_draw(txt, x, y); *before* I call fl_measure(...) to 
determine the size, whereas the render_text test (which I think I also wrote, 
actually!) does it the other way around, that is it measures the text *before* 
it attempts to draw it - which if you think about it is the much more sensible 
way to do it... Why measure it once it is already drawn? That's just too late 
by then!

So, anyway, that appears to be the key; if you draw first, then measure, you 
get consistent good results, if you measure first, then draw... well, not so 
good. I guess (have not looked yet) that calling fl_draw() must be "locking in" 
the font in some way, and that prior to calling draw the call to fl_measure 
does not get the correct face, or something...

A very brief test on OSX and linux suggests that this is a winXX specific 
issue, FWIW...
-- 
Ian


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

Reply via email to