• 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: scale text proportionally as bounds increase
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: scale text proportionally as bounds increase
      • From: sqwarqDev <email@hidden>
References: 
 >scale text proportionally as bounds increase (From: sqwarqDev <email@hidden>)

  • Prev by Date: Re: get class of a method's returned object
  • Next by Date: Re: NSOpenPanel() crash in Swift 1.1 -- SOLVED?
  • Previous by thread: Re: scale text proportionally as bounds increase
  • Next by thread: Re: scale text proportionally as bounds increase
  • Index(es):
    • Date
    • Thread