• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSString drawInRect clipping control
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSString drawInRect clipping control
      • From: Ondra Cada <email@hidden>
    • Re: NSString drawInRect clipping control
      • From: Markus Hitter <email@hidden>
References: 
 >Re: NSString drawInRect clipping control (From: Markus Hitter <email@hidden>)

  • Prev by Date: Re: DVD in Cocoa
  • Next by Date: Re: Faster way to draw strings?
  • Previous by thread: Re: NSString drawInRect clipping control
  • Next by thread: Re: NSString drawInRect clipping control
  • Index(es):
    • Date
    • Thread