• 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
Font problem: iOS5 NSString's sizeWithFont returns integral values unlike drawAtPoint
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Font problem: iOS5 NSString's sizeWithFont returns integral values unlike drawAtPoint


  • Subject: Font problem: iOS5 NSString's sizeWithFont returns integral values unlike drawAtPoint
  • From: David Hoerl <email@hidden>
  • Date: Fri, 21 Oct 2011 09:07:01 -0400

I was having this bizarre issue with some odd text alignments. In the end I tracked it down to sizeWithFont returning different CGSizes than did drawAtPoint. The latter returns widths (using Courier 19pt bold) of around 12.002 while sizeWithFont says 13.00. Its like sizeWithFont is using "ceilf" on the values...

Is this a documentation issue or system problem?

In the end I just use a clearColor to draw the text, but boy was I surprised at this.

David
_______________________________________________

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


  • Follow-Ups:
    • Re: Font problem: iOS5 NSString's sizeWithFont returns integral values unlike drawAtPoint
      • From: David Duncan <email@hidden>
  • Prev by Date: playing a streamed audio file
  • Next by Date: Re: Core Data: Determine if managed object is deleted
  • Previous by thread: Re: playing a streamed audio file
  • Next by thread: Re: Font problem: iOS5 NSString's sizeWithFont returns integral values unlike drawAtPoint
  • Index(es):
    • Date
    • Thread