Re: scale text proportionally as bounds increase
Re: scale text proportionally as bounds increase
- Subject: Re: scale text proportionally as bounds increase
- From: Jens Alfke <email@hidden>
- Date: Mon, 23 Feb 2015 14:08:26 -0800
> On Feb 23, 2015, at 8:49 AM, sqwarqDev <email@hidden> wrote:
>
> How do I programmatically tell each NSControl to increase its text size proportionally as its bounds increase?
You’ll have to do it manually. Observe the control’s frame, then when it changes compute a new font size and update the control’s font.
(The easy way is to assume that text width scales linearly with font size; strictly speaking this isn’t always true, but it’s probably true of any standard system font like Helvetica that you’d be displaying in a control.)
—Jens
_______________________________________________
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