Re: What's wrong with this font thing?
Re: What's wrong with this font thing?
- Subject: Re: What's wrong with this font thing?
- From: Randall Meadows <email@hidden>
- Date: Wed, 29 Oct 2008 17:37:21 -0600
On Oct 29, 2008, at 5:15 PM, Peter Ammon wrote:
Trying to find the right font size to just fit the text seems a bit
archaic. Here is a different approach:
- Measure the string with some font
- Divide the space available by the measured width to find the scale
factor
- Use CGContextScaleCTM() to apply the scale to the current transform
- Draw the string with that font. It will scale nicely and fit into
the available space.
Doing that also shifts the rect that I'm trying to draw into. I'm
doing multiple NSString drawInRect:withAttributes: calls, all within a
single view.
_______________________________________________
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