Re: NSString drawInRect clipping control
Re: NSString drawInRect clipping control
- Subject: Re: NSString drawInRect clipping control
- From: "Mark's Studio" <email@hidden>
- Date: Wed, 23 Jan 2002 18:15:46 +0100
Thanks that worked.
But i still don't understand why drawInRect is not doing the same thing
when there is a space in the string,
it looks like drawInRect is doing the same thing when it's just one long
string.
BUG?
On onsdag, januar 23, 2002, at 05:47 , Markus Hitter wrote:
>
>
Am Mittwoch den, 23. Januar 2002, um 14:18, schrieb Mark's Studio:
>
>
> Thanks for your reply
>
>
>
> Yes i do want clipping.
>
> im drawing into a view used for printing
>
> so the size of the rect will change with different paper size
>
>
>
> I want the same clipping as when there is no spaces in the string.
>
>
This is what I meant:
>
>
NSMutableString *tmpString = [printString mutableCopy];
>
>
while ([tmpString sizeWithAttributes:attributes].width >
>
textRect.size.width) {
>
[tmpString deleteCharactersInRange:NSMakeRange([tmpString
>
length] - 2, 1)];
>
}
>
[tmpString drawInRect:textRect withAttributes:attributes];
>
[tmpString release];
>
>
>
Can't help you for drawing partial characters, else than to extent your
>
textRect by one character width, then overdraw it partially with
>
background color.
>
>
>
Hope that helps,
>
Markus
>
>
- - - - - - - - - - - - - - - - - - -
>
Dipl. Ing. Markus Hitter
>
http://www.jump-ing.de/
>
>
>
>
Peter Mark
Mark's Recording Studio A/S
Faelledvej 19 b DK2200 N
Copenhagen Denmark
Tel: +45 35366078 Fax: +45 35366038
www.marks-studio.dk
email@hidden