realbasic-nug
[Top] [All Lists]

Re: Drawing string in Canvas

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Drawing string in Canvas
From: Austin Clow <dr_clow at mac dot com>
Date: Sat, 31 Jul 2004 17:10:55 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <r02010200-1034-FF47E612E33D11D881C2000A95C8DD62 at [192 dot 168 dot 2 dot 1]>
There is a function called StringHeight for the graphic property

StringHeight(test as string, wrapwidth as integer)

WrapWidth would be the width of your column.

On Jul 31, 2004, at 5:07 PM, Jan Erik Moström wrote:

On 2004-07-31 22:45, tjmac at tolisgroup dot com wrote:

You'll need to add your line height to the current y value if the text
lines
are to be in normal paragraph layout. However, your comment about the "two columns" implies that you really meant the x value. If that is the case, decide where you want the column split to occur and set the new x value to
this number.

No I mean the vertical position, I want to write a number of string pairs
like this

pair1_a         pair1_b
pair2_a         pair2_b pair2_b pair2_b pair2_b pair2_b
                pair2_b pair2_b pair2_b pair2_b pair2_b
                pair2_b pair2_b pair2_b pair2_b pair2_b
pair3_a         pair3_b pair3_b pair3_b pair3_b pair3_b
                pair3_b pair3_b pair3_b pair3_b

I can easily add the height when each of the pairs is one line only (pair1) but if I have a string that is more than one line (most common case) it seems sensible to use the string width to get the text formatted like in pair2_b but when I want to write pair3 I need to know the vertical position. And I
can't figure out where I can get it after having used the string width.

I'm sure there is somewhere I can find this out (because otherwise I have to write a duplicate of the formatting in drawstring just figure out the height
... and it seems silly) but I can't find it.


                jem
--
Jan Erik Moström   www.mostrom.pp.se
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>