Hi Jeremy, On Sun, Dec 23, 2007 at 02:40:38PM +0000, Jeremy Henty wrote:
If you point Dillo at <URL:http://starurchin.org/dillo/bugs/form_setfont.html> you'll see that the textareas are rendered with different widths despite having the same number of columns.
I see. Good example.
The problem is that FltkResource objects don't call ::fltk::setfont before calling ::fltk::getwidth to calculate their width, so they use the font that was set by the previous header elements, even though those elements were properly closed in the HTML source.
OK.
This patch adds the missing ::fltk::setfont calls to Fltk{Entry,Button,Multiline}Resource .
Committed!
I've looked at all other uses of ::fltk::getwidth. The ones in dw2-cur/dw/fltkplatform.cc are properly protected by calls to ::fltk::setfont , but the ones in dw2-cur/dw/fltkpreview.cc and dillo2-cur/src/dialog.cc are not. I can't tell if they need to be protected, perhaps the current FLTK font is always correct when they are called? Thoughts?
Yes, they should be protected. AFAIS, every function sets its proper font, but doesn't restore the previous one. With regard to dialog: it'd be nice to set the font size considering prefs.font_factor. For fltkpreview.cc, it'd be good to at least add a commented statement because it clearly is in a state of flux (and ifdefed out). -- Cheers Jorge.-