What fonts are available on iOS 4.2?

I'm looking for an official list of available fonts in iOS 4.2, since Apple has included more fonts with update 4.2.

Unfortunately, I cannot find anything in the main documentation or on the Apple developer site; but I faintly remember that somewhere I saw "official," that is, a list made by Apple with all the fonts available on iOS.

If someone can point me to the documentation, that would be good. :)

Thanks in advance!

Update:

Found an app called Fonts on the App Store (free). It simply displays all the fonts on the device.

+5
source share
2 answers
+3

(iPhone iPad)

- (void)getAllFonts{
   NSArray *fontFamilies =[UIFont familyNames];

   for(int i =0; i <[fontFamilies count]; i++){
       NSString *fontFamily =[fontFamilies objectAtIndex:i];
       NSArray *fontNames =[UIFont fontNamesForFamilyName:[fontFamilies objectAtIndex:i]];
       NSLog(@"%@: %@", fontFamily, fontNames);
   }
}

/ [self getAllFonts];

EDIT: , ,

1:

@interface FontViewController (){
    NSArray* fontFamilies;
}

2: (.m) viewDidLoad.

-(void)viewDidLoad{
    fontFamilies = [UIFont familyNames];
}

STEP3: , cellForRowAtIndexPath

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
 {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

    // The Magic :)    
    cell.textLabel.text = [fontFamilies objectAtIndex:indexPath.row];
    cell.textLabel.font = [UIFont fontWithName:[fontFamilies objectAtIndex:indexPath.row] size:12];

    return cell;
}

PS: , . tableView Cell ( xib) "Cell", , :

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return fontFamilies.count;
}

, Apple

. AppCoda

+2

All Articles