Posted By

rabc on 07/29/10


Tagged

font iphone UIFont


Versions (?)

Who likes this?

7 people have marked this snippet as a favorite

joshparnham
umang_nine
bobbym245
sb
Tintenklecks
nellynette
cnathan


List all fonts


 / Published in: Objective C
 

  1. NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
  2.  NSArray *fontNames;
  3.  NSInteger indFamily, indFont;
  4.  for (indFamily=0; indFamily<[familyNames count]; ++indFamily)
  5.  {
  6.      DEBUGLOG(@"Family name: %@", [familyNames objectAtIndex:indFamily]);
  7.      fontNames = [[NSArray alloc] initWithArray:
  8.          [UIFont fontNamesForFamilyName:
  9.          [familyNames objectAtIndex:indFamily]]];
  10.      for (indFont=0; indFont<[fontNames count]; ++indFont)
  11.      {
  12.          DEBUGLOG(@"    Font name: %@", [fontNames objectAtIndex:indFont]);
  13.      }
  14.      [fontNames release];
  15.  }
  16.  [familyNames release];

Report this snippet  

You need to login to post a comment.