Skip navigation
This discussion is archived

How to set font, font size in iPhone app using Interface Builder

4449 Views 3 Replies Latest reply: May 17, 2009 10:44 PM by RayNewbie RSS
sneakyimp Calculating status...
Currently Being Moderated
May 15, 2009 4:43 PM
I'm learning how to code for iPhone. I've added a Label to my iPhone Window object and I'm trying to set the font size and face. I've tried everything on the font menu (bigger, smaller) and this seems to do nothing. I've tried cmd-T which shows the fonts window but selecting a font there does not always change my font. Selecting a font in the fonts window seems to work for some fonts but not others and I can see no rhyme or reason to which fonts work and which do not. Courier and Courier new seem to work as does Georgia, Zapfino, and some other totally random ones.


Do I need to add the fonts to my project? Are some fonts simply not going to work? Are certain fonts available on the iPod and others not?
iMac, Mac OS X (10.5.6), iPhone 2.0
  • RayNewbie Level 5 Level 5 (6,810 points)
    Are certain fonts available on the iPod and others not?

    Yes. The font selection shown in IB includes all of the fonts installed on the Mac host. Only a subset of these is available on the iPhone. When you select an unavailable font for an iPhone project, IB will just give you the default or the available font that was last selected.

    Btw, there are at least two free iPhone apps that will display the available fonts. I have FontViewer.

    Font selection in IB can be a little tricky. For example, you might select a UILabel instance, then select a different size or style in the Font window and find the selection doesn't affect the label. You need to "sync" the editor window with the Font window. I've found the best way is to tab through the controls while the Font window is open. At some point you'll see it "catch" and the selections in the window will start to track the selected controls. When that happens, you should be able to tab to the label and make the change you want.
    MacBook, Mac OS X (10.5.4)
  • RayNewbie Level 5 Level 5 (6,810 points)
    You're very welcome. No, we didn't feel that one. Watsonville is about 90 mi. south of San Fran. We're about 5 mi. inland from Monterey Bay.

    Wishing you every success with your app,
    MacBook, Mac OS X (10.5.4)


More Like This

  • Retrieving data ...

Bookmarked By (0)


  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.