3

I'm developing an application and I have to use a custom Font Family Name : Montserrat in my app.So can anyone help me how to do this?

Font Family Name : Montserrat
Ganesh Kumar
  • 708
  • 6
  • 25
  • possible duplicate of [Can I embed a custom font in an iPhone application?](http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone-application) – The dude Oct 15 '14 at 07:16
  • 1
    http://stackoverflow.com/questions/13029660/use-custom-fonts-in-iphone-app – The dude Oct 15 '14 at 07:18
  • 1
    http://stackoverflow.com/questions/3837965/how-to-add-custom-fonts-to-an-iphone-app?lq=1 – The dude Oct 15 '14 at 07:18
  • @Thedude i have done all those things but am getting in Nslog as (null). – Ganesh Kumar Oct 15 '14 at 07:20
  • then in your question you should state what you have tried to achieve it and what is the issue you found. Please refer to the help section and check out how to ask a good question: http://stackoverflow.com/help/how-to-ask – The dude Oct 15 '14 at 07:22

2 Answers2

2
  1. Use the IBCustomFonts if you want the font will apply on Storyboard

  2. Category the UIFont class to apply this font every that you want to change.

HaiN
  • 917
  • 11
  • 31
2

Drag and drop the custom font family with style into your project.

In your app -->info.plist,You should have add like this

enter image description here

After that we can easily check the family in the Interface Builder->Show the Attribute Inspector.

enter image description here

Programmatically

UIFont* font = [UIFont fontWithName:@"Montserrat" size:20];

You can also check whether the font family file is added or not by put this code into your project.

for (NSString *fontFamilyName in [UIFont familyNames]) 
{
for(NSString *fontName in [UIFont fontNamesForFamilyName:fontFamilyName]) 
{
    NSLog(@"Family: %@    Font: %@", fontFamilyName, fontName);
}
}
Ganesh Kumar
  • 708
  • 6
  • 25