Can I install a system font in Xcode?

In Xcode, I use a fixed UILabel with a font system, set the text in IB, and set the size exactly by pressing Command =

If I run this on an iPad 2 or iPad simulator (no retina), it displays OK. If I run this on an iPad 3 or iPad simulator (retina), it sometimes disables text. An example of a cut-off text: "Min." displayed as "M .."

After some searching, I found that this is because the system font is different: Helvetica on a non-retina iPad. Helvetica Neue on iPad Retina. Therefore, the shortcuts seem to be Ok at design time, but are cropped on the mesh displays. Helvetica Neue seems a little wider. If I copy the font to Helvetica Neue in IB and press Command- =, the size will be adjusted by 1 pixel to fit the font.

It seems that IB in Xcode uses Helvetica. Can this be switched to Helvetica Neue? I would rather switch the font used in Xcode instead of hard-coding all my fonts to Helvetica Neue.

+4
source share
2 answers

Your instinct is right if you do not want to hardcode a specific font, as further changes to the system font will leave your application obsolete or uncomfortable. To avoid this, use Autolayout (a layout with restrictions) to make your shortcuts fit the text dynamically.

Watch the 2013 WWDC videos, in particular Building User Interfaces for iOS7 , for a discussion of type system updates and Taking control of auto-layout in Xcode 5 for a discussion of implementation changes.

+2
source

The question you ask already answered here: Set the default style, color and font size for the xcode project . Here is a video of the WWDC session cited in this answer and tells how to set up the default user interface: https://developer.apple.com/videos/wwdc/2012/?id=216

+1
source

All Articles