[Gambas-user] Paint.DrawRichText and Paint.RichText
Rolf-Werner Eilert
rwe-sse at osnanet.de
Thu Dec 19 11:25:05 CET 2019
Am 19.12.19 um 10:43 schrieb Benoît Minisini:
> Le 19/12/2019 à 10:11, Rolf-Werner Eilert a écrit :
>>
>> Hm, can't find it, neither where you said nor in the farm. But I do
>> remember it, I looked at it some years ago, and I guess there will be
>> no answer to my question.
>>
>> What I miss is a property or a function that gives me the end
>> coordinates of the path when the text was finished. Using X and Y only
>> yields the start coordinates. DrawText or DrawRichText will paint the
>> text starting with X and Y, but afterwards the program has no control
>> about where the text in fact ends.
>>
>> It could make life a lot easier to have these coordinates, because you
>> could then simply add the next paragraph or decide to start the next
>> page.
>>
>> If there is no way how to find out, I would have the do the job
>> myself, leaving DrawRichText aside. It would mean to build my own
>> function.
>>
>> Regards
>> Rolf
>>
>
> I'm aware of that problem, but AFAIK QT and GTK+ do not provide any way
> to get this very useful information!
>
> You have to use the TextWidth() and TextHeight() method to get the size
> of a text before or after drawing it, which does the job almost twice.
>
> If anyone has more information on this subject, he's welcome!
>
> Regards,
>
Aaah, I found RichTextExtents and RichTextSize. At least that works.
RTFM :))))
But, as I found now, when I give HTML tags
<b></b> will make text bold
<i></i> has no effect
<u></u> makes lines somewhere a few lines deeper than the text
Strange, isn't it?
Regards
Rolf
More information about the User
mailing list