[racket] display problem

From: Roelof Wobben (r.wobben at home.nl)
Date: Fri Apr 6 02:58:35 EDT 2012

Op 5-4-2012 20:28, Stephen Bloch schreef:
> On Apr 5, 2012, at 1:39 PM, Roelof Wobben wrote:
>
>> Op 5-4-2012 19:28, Danny Yoo schreef:
>>> Can you get the position where the cursor should start by
>>> taking the image for the left side text, and take its width?
>>>
>> ...
>> I start with this :
>>
>> aaaaa|
>>
>> now someone press 3 times the left key.
>> So I have  aa/aaa
>> How can I know where the cursor is now.
>> Or can I do  width - 3 times 11 ?
> You could do that, but it's not guaranteed to give you the right answer, because not all characters in a font are necessarily the same width.  How about (as Danny suggested) making an image of the left side text, and taking its width?
>
>
> Stephen Bloch
> sbloch at adelphi.edu
>
>

I can do that as starting point when I have this situation aaaaaaa|
But how can i make a image if it's like this : aaa|aaa
I could use substring but then I have to know which letter I have to cut.
And whith this world I cannot know that.

Roelof


Posted on the users mailing list.