Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 609
wagill Avatar asked Sep 23 '15 19:09

wagill


People also ask

What is the default system font for Mac?

System fonts The primary system font in OS X El Capitan and above is San Francisco. OS X Yosemite used Helvetica Neue, and preceding versions largely employed Lucida Grande.


1 Answers

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/

like image 197
bhaller Avatar answered Sep 28 '22 11:09

bhaller