Custom Font for iOS Only shows if Added in IB?

47 Views Asked by At

My font file name is "CONSELHEIRO.otf". It is located in a folder called 'fonts'. I have added this file to Xcode, and made sure that it was indeed added to the target. I added it in the "Fonts provided by application" part of Info.plist as well. I have tried to confirm this by running this in AppDelegate:

for (NSString *familyName in [UIFont familyNames]){
        NSLog(@"Family name: %@", familyName);
        for (NSString *fontName in [UIFont fontNamesForFamilyName:familyName]) {
            NSLog(@"--Font name: %@", fontName);
        }
    }

The font would not appear in the console when I did this. I then went into my storyboard, and added a UILabel to one of my views, and clicked custom, and sure enough, "CONSELHEIRO" was one of my options. I then built the app, and voila, it appeared in the console, as well as the font for the UITableView I had wanted it to appear on. So, thinking I had it solved, I went ahead and deleted the UILabel from IB, and once again, the font would not appear in console, or in the table view.

enter image description here enter image description here

I can't for the life of me figure out why this is causing any difference at all, and I'd rather NOT have this random UILabel visible in my app. Anyone have any suggestions for what may be causing this? The PostScript name is "Conselheiro", but changing capitalization across the app does not seem to make a difference.

Since there's some question as to whether I'm doing everything right, in addition to the two different screenshots above where I have shown trying to do both upper or lowercase, here's more screenshots showing it is in the project bundle, and added to the target.

enter image description here

enter image description here

0

There are 0 best solutions below