here is code, it is strange, if text is text without spaces it
returns good
w value, but if there are spaces "sadfsdfasdf adsfasdf" it gives w
some
about "sadfsdfasdf" but not all... h value is alvays good...
int w, h;
...
fl_measure(text, w, h);
The manual to fl_measure says: "Measure how wide and tall the string
will be when printed by the fl_draw(...align) function. If the
incoming w is non-zero it will wrap to that width.".
So in you case, you must set w and h to zero before calling the
function, or it will do text wrapping at the space character
(depending on what random value is in w).
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.