DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2941
Version: 1.3-feature


Yes, I thought about that at the time, but chose not to do it.

The problem is, it is not obvious what the right answer is, for a string
that has carriage returns / line feeds in it.

In particular; What is the resulting vertical height?

It will presumably *not* be the sum of the vertical heights of the
constituent "sub-strings", since that will not account for the vertical
leading between the rows of text - assuming the rows are rendered by the
host system's regular text drawing mechanism.

So, for multi-line text, you probably *need* to render each line yourself,
if you care about the inked extent, so that you can directly control the
vertical leading between rows. Or, use fl_measure and accept that it will
return a bounding box that is "larger" than the inked extent... I suspect
that in the case of multi-line text that fl_measure will usually be more
useful anyway.

Hmm, now I think about it, I'm not even sure I know what the various
different host text systems do with measuring the extents of wrapped
text... It is even possible that *some* of them might even "get this
right", i.e. return a bounding box that describes the inked extents,
incorporating the vertical leading.

But I do not know for sure, and certainly some of the text systems Do Not
"get this right", so...

It's tricky.


Link: http://www.fltk.org/str.php?L2941
Version: 1.3-feature

_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to