0

I’m working on an iOS framework that contains few nib files. Each nib has a custom font. I can see the custom font inside the Interface builder, but when I test the framework in a regular iOS project, The custom font replaced with default one.

I followed this answer to add the custom font : How to include and use new fonts in iPhone SDK?

Maor
  • 3,040
  • 3
  • 27
  • 37
  • 1
    Don't forget to add the fonts to the targets compile bundle resources. – Vandit Mehta Mar 12 '18 at 08:28
  • So the font is being set from IB only ? – Nitish Mar 12 '18 at 08:30
  • Hi @VanditMehta, all the fonts added under Build Phases >> Copy Bundle Resources – Maor Mar 12 '18 at 08:30
  • Hi @Nitish , Yes. – Maor Mar 12 '18 at 08:31
  • you can check whether the font is added well to your application or not by running below code, for (NSString* family in [UIFont familyNames]) { NSLog(@"%@", family); for (NSString* name in [UIFont fontNamesForFamilyName: family]) { NSLog(@" %@", name); } } – Vandit Mehta Mar 12 '18 at 08:32
  • Can you share screenshots of : 1. IB where font is set 2. Copy bundle resources (keep the font in focus) 3. Project directory in finder with font in focus 4. Info.plist where fonts are added. – Nitish Mar 12 '18 at 08:35
  • One thing I noticed - text is not displayed on label even though it is set. I edited my above comment. Can you also upload Infor.plist screenshot containing fonts ? – Nitish Mar 12 '18 at 08:45
  • @Nitish https://imgur.com/a/vTwE0 – Maor Mar 12 '18 at 09:02

0 Answers0