• 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
NSString -drawWithRect:options:attributes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSString -drawWithRect:options:attributes


  • Subject: NSString -drawWithRect:options:attributes
  • From: Steve Cronin <email@hidden>
  • Date: Thu, 16 Aug 2007 02:39:30 -0500

Folks;

I'm trying to draw text into a view:

[myImageTitleString drawWithRect:titleRect options:NSStringDrawingUsesLineFragmentOrigin attributes:labelAttributes];

Some of the time its fine - some of the time its not.
It seems to depend on the NSFont declared in the NSFontAttributeName in the 'labelAttributes'


The docs for the method state:
"...the rect argument's origin field specifies the rendering origin. The point is interpreted as the baseline origin by default.
With NSStringDrawingUsesLineFragmentOrigin, it is interpreted as the upper left corner of the line fragment rect. ..."


What I observe (10.4.10) is that some fonts seem to honor the 'upper left' designation for the option 'NSStringDrawingUsesLineFragmentOrigin' but some do not.
Some fonts (Garamond) seem to draw with the rect as the baseline and so the descenders are not visible in my tight view.


Is this something that others have observed. Is there a better way to specify the rect or accomplish this task?

All other aspects of the drawing are correct: justification, line breaking, text color...

Thanks for any thoughts!
Steve


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: fitting an NSBezierPath to a Rect
  • Next by Date: Re: Printing contents of the active Desktop window
  • Previous by thread: Developing iSync Conduits
  • Next by thread: WithAndWithoutBindings
  • Index(es):
    • Date
    • Thread