[REBOL] Re: drawing images on text face after displayed = "highlighting text"
From: henrikmk::gmail at: 1-Oct-2008 15:02
On Wed, Oct 1, 2008 at 2:41 PM, Alan Macleod <fergus4-bellatlantic.net> wrote:
> Henrik,
>
> How do you use size-text to find the size for a row or highlighted section?
> I can only find the size of the entire text face.
You shouldn't use size-text on the original face.
Something like:
size-text make t [size: 2000x50 text: highlighted-text]
Explanation: You make a copy of the original text face for measurement
purposes, and then let it only contain the highlighted text. (I guess
View needs to render the text internally to return the size of it.)
You then need the exact same text attributes (font and para) for it to
measure the size correctly. You also need a rather big size in order
for the text in the new face to flow correctly to avoid unintended
linebreaks as we want the text to match the original.
--
Regards,
Henrik Mikael Kristensen