0

I'm currently writing a database app via storyboards, and I'm right now I am in the stage of making it look fancy. I've added the font, Gotham.ttf, to the app with Info.plist. And yes, I did copy the font file into the project.

Info.plist

Within my ViewController.m I have the following code:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
    
    // Cell Configuration
    NSManagedObject *device = [self.devices objectAtIndex:indexPath.row];
    [cell.textLabel setText:[NSString stringWithFormat:@"%@ %@", [device valueForKey:@"name"], [device valueForKey:@"version"]]];
    [cell.detailTextLabel setText:[device valueForKey:@"company"]];
    cell.textLabel.font = [UIFont fontWithName:@"Gotham" size:20];
    
    return cell;
}

Everything works fine in the code. I know this because if I change Gotham to "Arial" or "Tahoma", the fonts come out fine when I launch the app. But when I try to change the font of the label to "Gotham", it just reverts to the default font used for a cell. I have definitely implemented the font wrong, I'm just not sure where I have gone wrong.

halfer
  • 19,824
  • 17
  • 99
  • 186
JDev
  • 5,168
  • 6
  • 40
  • 61

1 Answers1

0

Please see details here:

Can I embed a custom font in an iPhone application?

Did you follow all the steps thoroughly?

Also, do you really have the file extension tff? It should be ttf for 'true type font'.

Community
  • 1
  • 1
occulus
  • 16,959
  • 6
  • 53
  • 76