iPhone system font

232,362

Solution 1

To the delight of font purists everywhere, the iPhone system interface uses Helvetica or a variant thereof.

The original iPhone, iPhone 3G and iPhone 3GS system interface uses Helvetica. As first noted by the always excellent DaringFireball, the iPhone 4 uses a subtly revised font called "Helvetica Neue." DaringFireball also notes that this change is related to the iPhone 4 display rather than the iOS 4 operating system and older iPhone models running iOS 4 still use Helvetica as the system font.

iPod models released prior to the iPhone use either Chicago, Espy Sans, or Myriad and use Helvetica after the release of the iPhone.

From http://www.everyipod.com/iphone-faq/iphone-who-designed-iphone-font-used-iphone-ringtones.html

For iOS9 it has changed to San Francisco. See http://developer.apple.com/fonts for more info.

Solution 2

If you're doing programatic customisation, don't hard code the system font. Use UIFont systemFontOfSize:, UIFont boldSystemFontOfSize: and UIFont italicSystemFontOfSize (Apple documentation).

This has become especially relevant since iOS 7, which changed the system font to Helvetica Neue.

This has become super especially relevant since iOS 9, which changed the system font again to San Francisco.

Solution 3

afaik iPhone uses "Helvetica" by default < iOS 10

Solution 4

Swift

Specific font

Setting a specific font in Swift is done like this:

let myFont = UIFont(name: "Helvetica", size: 17)

If you don't know the name, you can get a list of the available font names like this:

print(UIFont.familyNames())

Or an even more detailed list like this:

for familyName in UIFont.familyNames() {
    print(UIFont.fontNamesForFamilyName(familyName))
}

But the system font changes from version to version of iOS. So it would be better to get the system font dynamically.

System font

let myFont = UIFont.systemFontOfSize(17)

But we have the size hard-coded in. What if the user's eyes are bad and they want to make the font larger? Of course, you could make a setting in your app for the user to change the font size, but this would be annoying if the user had to do this separately for every single app on their phone. It would be easier to just make one change in the general settings...

Dynamic font

let myFont = UIFont.preferredFont(forTextStyle: .body)

Ah, now we have the system font at the user's chosen size for the Text Style we are working with. This is the recommended way of setting the font. See Supporting Dynamic Type for more info on this.

Related

Solution 5

You can always use

UIFont *systemFont = [UIFont systemFontOfSize:12];
NSLog(@"what is it? %@ %@", systemFont.familyName, systemFont.fontName);

The answer is:

Up to iOS 6

 Helvetica Helvetica

iOS 7

.Helvetica Neue Interface .HelveticaNeueInterface-M3

but you can just use Helvetica Neue

Share:
232,362
Ken
Author by

Ken

Updated on July 22, 2020

Comments

  • Ken
    Ken almost 4 years

    What is the name of the default system font on the iPhone?

    I would like to retrieve this for customizing a UIView.

  • Ken
    Ken over 13 years
    I'm not going to change the system font, that's a bad idea. But I want it for some html in UIWebView.
  • Adam Wright
    Adam Wright over 13 years
    This doesn't change the system font - it just gives you UIFont instances of the system font using the given sizes, and will always return the system fonts regardless of future iOS updates.
  • Ken
    Ken over 13 years
    The font I'm seeing in my UIWebView doesn't looking like Helvetica to me. I might be wrong but setting the font for my view takes away my doubt.
  • Steven Baughman
    Steven Baughman over 12 years
    UIFont *font = [UIFont systemFontOfSize: 12.0]; <!-- gets default font
  • Krishnabhadra
    Krishnabhadra about 11 years
    There are easier methods.. But +1 for thinking out of the box
  • Augustine
    Augustine almost 11 years
    Currently it is Helvetica Neue Regular font.
  • Dan Rosenstark
    Dan Rosenstark almost 11 years
    "don't hard code the system font" is good advice, or really bad advice, depending on the situation. Personally, I wish I had hardcoded Helvetica... doing that now.
  • Esteve
    Esteve over 10 years
    Totally agree, don't hardcode, please. This should be the right answer to this question
  • Anton Gaenko
    Anton Gaenko about 10 years
    It looks better :P [UIFont systemFontOfSize:[UIFont labelFontSize]]; See my answer below.
  • ericosg
    ericosg about 9 years
    as seen by other answers, it depends on iOS version
  • Freek Sanders
    Freek Sanders almost 9 years
    For iOS9 it has changed to San Fransisco. See developer.apple.com/fonts for more info.
  • Daniel
    Daniel almost 8 years
    in Swift on iOS 9 I get .SFUIText-Regular as systemFont.familyName
  • Dan Rosenstark
    Dan Rosenstark almost 8 years