Search code examples
macoscocoanstextfield

How to handle System Font change between OS X 10.9 and 10.10


Some but not others of the beta testers of my current app project have reported clipping of NSTextField views. This had me stumped until I realized that OS X 10.9 and 10.10 use a different font as System Font (Lucida Grande vs. Helvetica Neue). Is there an accepted practice for programmatically handling this situation? I realize that I can make my NSTextFields wider; however, I am looking for a solution where several NSTextFields that are adjacent to each other will not clip. Many thanks.


Solution

  • If you use Cocoa's Auto Layout facilities, this is a non-issue. All of your nibs will automatically readjust to the new font metrics. https://developer.apple.com/library/mac/releasenotes/UserExperience/RNAutomaticLayout/