Ajnaware’s Weblog

Web, Mobile & iPhone software development

List of Fonts Available on the iPhone

with 29 comments

The system font on the iPhone is a good choice for many purposes. You can easily select it in a regular, bold or italic style using built-in font class methods. For example

  UIFont *mainTitleFont = [UIFont boldSystemFontOfSize:14.0];
  UIFont *subTitleFont = [UIFont SystemFontOfSize:14.0];
  UIFont *textFont = [UIFont italicSystemFontOfSize:12.0];

 
But what if you want a font using both bold and italic at the same time, or a different typeface altogether? In that case, you can use the “fontWithName” method as follows.

  UIFont *altFont = [UIFont fontWithName:@"Courier-Bold" size:14.0];

 
This is all well and good, but how did you know what font names and variants are available? If you just guess and get the name wrong, your code will throw an exception – there is no graceful mapping to nearest available font here!

I couldn’t find the list of available font names anywhere in the iPhone documentation, or for that matter even with a web search (at least within the first few pages of returned results). So instead I wrote a small snippet of code to list them for me.

  // List all fonts on iPhone
  NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
  NSArray *fontNames;
  NSInteger indFamily, indFont;
  for (indFamily=0; indFamily<[familyNames count]; ++indFamily)
  {
      NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]);
      fontNames = [[NSArray alloc] initWithArray:
          [UIFont fontNamesForFamilyName:
          [familyNames objectAtIndex:indFamily]]];
      for (indFont=0; indFont<[fontNames count]; ++indFont)
      {
          NSLog(@"    Font name: %@", [fontNames objectAtIndex:indFont]);
      }
      [fontNames release];
  }
  [familyNames release];

 
Using the iPhone SDK v2.1, the resulting output was as follows.

Family name: Hiragino Kaku Gothic ProN W3
    Font name: HiraKakuProN-W3
Family name: Courier
    Font name: Courier
    Font name: Courier-BoldOblique
    Font name: Courier-Oblique
    Font name: Courier-Bold
Family name: Arial
    Font name: ArialMT
    Font name: Arial-BoldMT
    Font name: Arial-BoldItalicMT
    Font name: Arial-ItalicMT
Family name: STHeiti TC
    Font name: STHeitiTC-Light
    Font name: STHeitiTC-Medium
Family name: AppleGothic
    Font name: AppleGothic
Family name: Courier New
    Font name: CourierNewPS-BoldMT
    Font name: CourierNewPS-ItalicMT
    Font name: CourierNewPS-BoldItalicMT
    Font name: CourierNewPSMT
Family name: Zapfino
    Font name: Zapfino
Family name: Hiragino Kaku Gothic ProN W6
    Font name: HiraKakuProN-W6
Family name: Arial Unicode MS
    Font name: ArialUnicodeMS
Family name: STHeiti SC
    Font name: STHeitiSC-Medium
    Font name: STHeitiSC-Light
Family name: American Typewriter
    Font name: AmericanTypewriter
    Font name: AmericanTypewriter-Bold
Family name: Helvetica
    Font name: Helvetica-Oblique
    Font name: Helvetica-BoldOblique
    Font name: Helvetica
    Font name: Helvetica-Bold
Family name: Marker Felt
    Font name: MarkerFelt-Thin
Family name: Helvetica Neue
    Font name: HelveticaNeue
    Font name: HelveticaNeue-Bold
Family name: DB LCD Temp
    Font name: DBLCDTempBlack
Family name: Verdana
    Font name: Verdana-Bold
    Font name: Verdana-BoldItalic
    Font name: Verdana
    Font name: Verdana-Italic
Family name: Times New Roman
    Font name: TimesNewRomanPSMT
    Font name: TimesNewRomanPS-BoldMT
    Font name: TimesNewRomanPS-BoldItalicMT
    Font name: TimesNewRomanPS-ItalicMT
Family name: Georgia
    Font name: Georgia-Bold
    Font name: Georgia
    Font name: Georgia-BoldItalic
    Font name: Georgia-Italic
Family name: STHeiti J
    Font name: STHeitiJ-Medium
    Font name: STHeitiJ-Light
Family name: Arial Rounded MT Bold
    Font name: ArialRoundedMTBold
Family name: Trebuchet MS
    Font name: TrebuchetMS-Italic
    Font name: TrebuchetMS
    Font name: Trebuchet-BoldItalic
    Font name: TrebuchetMS-Bold
Family name: STHeiti K
    Font name: STHeitiK-Medium
    Font name: STHeitiK-Light

 
So when choosing a non-system font, you just have to make sure that you choose a font name from this list. Whether or not the list of font will change in future iPhone OS updates remains to be seen. It may be worth re-running this code snippet to see.

Late Addition: For samples of each font’s appearance, see my more recent post.

About these ads

Written by ajnaware

Friday, 24 October 2008 at 9:13 am

Posted in iPhone

29 Responses

Subscribe to comments with RSS.

  1. Awesome work Graham!

    Bonus points for rendering each font in its own font :-)

    Keith

    Friday, 24 October 2008 at 12:40 pm

  2. Thanks Keith. Yep! I’ll do it as soon as I find time to create a view to display them. Hmmm… I think it was meant to be about 5 days per view wasn’t it? Maybe I’d better sell it in the app store once its done!

    ajnaware

    Friday, 24 October 2008 at 2:02 pm

  3. interesting article thanks for the read!

    Sysbase

    Wednesday, 19 November 2008 at 5:39 pm

  4. Looks like Apple removed the font “Hiragino Kaku Gothic ProN W6″ in the 2.2 software update.

    Andrew

    Saturday, 22 November 2008 at 3:16 am

  5. Hi Andrew – thanks for the heads up so soon after the v2.2 release.

    ajnaware

    Saturday, 22 November 2008 at 11:42 am

  6. [...] related posts: (automatically generated)List of Fonts Available on the iPhonetypographerSea KanjiWho should be a main Leader along-side [...]

  7. Great info! We will do a video tutorial and add it to our site on selecting fonts and showing how the fonts look on the iPhone.
    Thank you.

    iPhoneToot.com

    Dave

    Wednesday, 11 February 2009 at 8:59 am

  8. Thanks a lot.
    You post exactly what I was looking for. I do all my string renderings with quartz and have found no other way to select a font than from its name.

    Jack

    Tuesday, 24 February 2009 at 9:12 pm

  9. [...] Let’s pick a new font. You need to set the font property of the cell to a UIFont. You’ll need a font name (a string) and a size. Here, we’re using Georgia. You can find a full list of font names here. [...]

  10. [...] 그리고 아래와 같이 간단하게 코드를 짜서 가능한 font 목록을 구할 수도 있습니다. [...]

  11. Excellent work. Notice that ten of the fonts seem to have missing characters where the Roman alphabet glyphs are. But the rest display fine.

    To create an array of font names for experimentation within code, I’ve modified your code a bit to read:

    + (void) listFonts {
    	NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
    	NSArray *fontNames;
    	NSInteger family, j;
    	int numFamilies = [familyNames count];
    	int numFonts = 0;	// tallied below
    	printf("static char* fontNames[] = {");
    	for (family=0; family < numFamilies; ++family)
    	{
    		//Log(@"Family name: %@", [familyNames objectAtIndex:indFamily]);
    		fontNames = [[NSArray alloc] initWithArray: [UIFont fontNamesForFamilyName: [familyNames objectAtIndex: family]]];
    		for (j=0; j<[fontNames count]; ++j)
    		{
    			Log(@"\"%@\", ", [fontNames objectAtIndex:j]);
    			++numFonts;
    		}
    		[fontNames release];
    	}
    	[familyNames release];
    	printf("};");
    	printf("#define NUMFONTS %d\n", numFonts);
    }
    

    Brent

    Sunday, 9 August 2009 at 8:49 pm

  12. Nice work!

    -yuzatom

    Tom

    Tuesday, 18 August 2009 at 4:48 am

  13. Same code using OS 3.0.1:

    Family name: AppleGothic
    Font name: AppleGothic
    Family name: Hiragino Kaku Gothic ProN
    Font name: HiraKakuProN-W6
    Font name: HiraKakuProN-W3
    Family name: Arial Unicode MS
    Font name: ArialUnicodeMS
    Family name: Heiti K
    Font name: STHeitiK-Medium
    Font name: STHeitiK-Light
    Family name: DB LCD Temp
    Font name: DBLCDTempBlack
    Family name: Helvetica
    Font name: Helvetica-Oblique
    Font name: Helvetica-BoldOblique
    Font name: Helvetica
    Font name: Helvetica-Bold
    Family name: Marker Felt
    Font name: MarkerFelt-Thin
    Family name: Times New Roman
    Font name: TimesNewRomanPSMT
    Font name: TimesNewRomanPS-BoldMT
    Font name: TimesNewRomanPS-BoldItalicMT
    Font name: TimesNewRomanPS-ItalicMT
    Family name: Verdana
    Font name: Verdana-Bold
    Font name: Verdana-BoldItalic
    Font name: Verdana
    Font name: Verdana-Italic
    Family name: Georgia
    Font name: Georgia-Bold
    Font name: Georgia
    Font name: Georgia-BoldItalic
    Font name: Georgia-Italic
    Family name: Arial Rounded MT Bold
    Font name: ArialRoundedMTBold
    Family name: Trebuchet MS
    Font name: TrebuchetMS-Italic
    Font name: TrebuchetMS
    Font name: Trebuchet-BoldItalic
    Font name: TrebuchetMS-Bold
    Family name: Heiti TC
    Font name: STHeitiTC-Light
    Font name: STHeitiTC-Medium
    Family name: Geeza Pro
    Font name: GeezaPro-Bold
    Font name: GeezaPro
    Family name: Courier
    Font name: Courier
    Font name: Courier-BoldOblique
    Font name: Courier-Oblique
    Font name: Courier-Bold
    Family name: Arial
    Font name: ArialMT
    Font name: Arial-BoldMT
    Font name: Arial-BoldItalicMT
    Font name: Arial-ItalicMT
    Family name: Heiti J
    Font name: STHeitiJ-Medium
    Font name: STHeitiJ-Light
    Family name: Arial Hebrew
    Font name: ArialHebrew
    Font name: ArialHebrew-Bold
    Family name: Courier New
    Font name: CourierNewPS-BoldMT
    Font name: CourierNewPS-ItalicMT
    Font name: CourierNewPS-BoldItalicMT
    Font name: CourierNewPSMT
    Family name: Zapfino
    Font name: Zapfino
    Family name: American Typewriter
    Font name: AmericanTypewriter
    Font name: AmericanTypewriter-Bold
    Family name: Heiti SC
    Font name: STHeitiSC-Medium
    Font name: STHeitiSC-Light
    Family name: Helvetica Neue
    Font name: HelveticaNeue
    Font name: HelveticaNeue-Bold
    Family name: Thonburi
    Font name: Thonburi-Bold
    Font name: Thonburi

    Tom

    Tuesday, 18 August 2009 at 4:50 am

  14. Hello !

    I’ve made a quick little app to test the rendering of a text in all the fonts available on the iPhone.
    You can find it at http://www.fontpickerapp.com

    Cheers !

    Etienne Segonzac

    Monday, 24 August 2009 at 9:14 pm

  15. Awesome work Etienne, thanks for this FREE app, really appreciated and helped me to pick a nice font for my game.

    Cheers,
    Guido

    Guido

    Wednesday, 26 August 2009 at 3:47 pm

  16. Hi,

    First of all, thanks for the sample.

    But I simplify a little bit the code

    //List all fonts on iPhone
    for (NSString* famName in [UIFont familyNames]) {
    NSLog(@”Family name: %@”,famName);
    for (NSString* fontName in [UIFont fontNamesForFamilyName:famName]) {
    NSLog(@” Font name: %@\n”, fontName);
    }
    }

    Wamuu

    Monday, 23 November 2009 at 9:25 pm

  17. [...] he usado. Además de modificar tamaños de texto, las fuentes que uso para iPhone/iPod mirando el listado de las preinstaladas, colores, cabeceras y pies, añadir el buscador a la plantilla y alguna cosas más, los más [...]

  18. To simplify it even further:

    NSLog(@”%@”, [UIFont familyNames]);

    It automatically enumerates the returned NSArray object when put into the string.

    %@ means any NSObject.

    Brandon

    Thursday, 12 August 2010 at 4:35 pm

  19. WONDERFUL guys..
    its so awesome..
    very very useful..!!!
    thank you very much for you creativity.. :)

    imam

    Thursday, 26 August 2010 at 3:39 pm

  20. bees4honey

    Tuesday, 18 January 2011 at 1:02 am

  21. Love love love love this post!

    Holy cow, I’ve been looking all over for this.

    Boggles my mind that the Apple docs don’t have simple reference lists like this. Things like date formatting, number formatting, fonts, etc. seem to be assumed. Thanks very much.

    Just added “AmericanTypewriter-Bold” into my app tonight. Thanks!

    Scott

    @heyscottyman
    Check out my iOS learnings and doings at http://www.myappventure.com

    heyscottyman

    Saturday, 19 March 2011 at 3:54 pm

  22. Hi. Nice info, I found it very useful.

    Just a little thing, you have:

    UIFont *subTitleFont = [UIFont SystemFontOfSize:14.0];

    at the top of the page, with the single line examples. But the SystemFontOfSize method should be systemFontOfSize (no capital s). I’m not sure if it works properly or not with the capital letter, but I didn’t catch that and my compiler gave me a warning. I never actual ran that iteration of the program to where it would have actually tried calling SystemFontOfSize.

    Anyway, thanks again, cheers.

    Fate

    Thursday, 24 March 2011 at 11:42 am

  23. Serj

    Tuesday, 2 August 2011 at 7:34 pm

  24. Come on guys, you could have at least sorted your font names for better readability. :)

    Jerry

    Wednesday, 2 November 2011 at 10:56 pm

  25. [...] [...]

  26. [...] Schließlich muss man noch herausbekommen, wie die Fonts eigentlich heißen — nicht die Dateien, sondern der Name, den “UIFont” erwartet. Mit einem kleinen Code-Schnipsel im “AppDelegate” geht das ganz leicht, wie z.B. auf Ajnaware’s Weblog gefunden: [...]

    Eigene Fonts in UILabels | Tim Gleue

    Thursday, 9 February 2012 at 7:19 am

  27. Thank you very much for the code. It helped me get the actual name of the font to use.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 793 other followers

%d bloggers like this: