• 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: behind the scenes of -drawInRect:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: behind the scenes of -drawInRect:


  • Subject: Re: behind the scenes of -drawInRect:
  • From: Douglas Davidson <email@hidden>
  • Date: Fri, 26 May 2006 15:35:32 -0700


On May 26, 2006, at 2:26 PM, Joshua Scott Emmons wrote:

Can anyone share a bit of the implementation details behind - [NSArrtibutedString drawInRect:]? I'm using it in -[NSView drawRect:] to place some text for printing.

I need to know the outputted text's height, but -[NSLayoutManager usedRectForTextContainer:] mysteriously cuts off the bottom 1/3 of the last line or two (depending on the size of the string). I figure this must be because of some sort of padding that's added to the string in -drawRect:, but I can't find any details as to how - drawRect: renders the text, so I don't know what variables I need to account for.


Take a look at Aki's post on typesetter behavior. That seems the most likely explanation of the discrepancy you are seeing.


Douglas Davidson

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: behind the scenes of -drawInRect:
      • From: Joshua Scott Emmons <email@hidden>
References: 
 >behind the scenes of -drawInRect: (From: Joshua Scott Emmons <email@hidden>)

  • Prev by Date: Re: Determining how the app is run (intel/ppc/rosetta/os version)?
  • Next by Date: Re: behind the scenes of -drawInRect:
  • Previous by thread: behind the scenes of -drawInRect:
  • Next by thread: Re: behind the scenes of -drawInRect:
  • Index(es):
    • Date
    • Thread