|
|
On 6/21/21 11:43 PM supsm17 wrote:
Thanks. I've noticed that widget->measure_label() and
fl_measure() have the same value, which isn't correct.
fl_text_extents() has a different value which is closer, but still
isn't the correct value. Do you know why this is?
As Greg already wrote, fl_text_extents() should be absolutely exact
but it's a little more difficult to use. You can see both
fl_measure() and fl_text_extents() "in action" in our
test/unittests.cxx demo program in the "rendering text" and "symbol
text" examples (the latter only with fl_measure()).
A potential problem with using these functions is that you need to
set the font before you call the measure functions.
Otherwise a random font will be used for measurement. This might
explain your differences.
If you can't find a solution, I suggest that you post your code in
form of a minimal, but compileable source code here. Then we can see
why it doesn't work for you and help.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/c70efd26-4f71-111e-5b73-5c6a8f76d9e0%40online.de.
[ Direct Link to Message ] | |
|
| |