How can we use custom font in an iOS app? [duplicate] - iphone

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Can I embed a custom font in an iPhone application?
How can I customize font in my iPhone app?
Is it possible?
How can I use this custom font in a UILabel?
I am trying to add MYRIADPRO-SEMIBOLD.OTF font in my App.
and the code is
UIFont *customFont = [UIFont fontWithName:#"MYRIADPRO-SEMIBOLD" size:35];
titleLbl.font = customFont;
And the Plist is

Try the steps below:
1. Make configuration in the info.plist as shown in Image
2. Now you should use that added file
UIFont *customFont = [UIFont fontWithName:#"fontName" size:size];
// further you may set That Font to any Label etc.
EDIT: Make Sure you have added that file in your resources Bundle.

Copy your font file into Resources.
In your application .plist create (if it exists just create a row) a row called Fonts provided by application and then in item 0 copy your font name for example Ciutadella-Bold.otf
Then you can define this font in your application:
UIFont *CiutadellaBold = [UIFont fontWithName:#"Ciutadella-Bold" size:17.0f];
And use it in for instance in UILabel:
[uiLabel setFont:CiutadellaBold];

It is totally possible. Please check the following links to implement your solution.
iPhone Development: how to use custom fonts?
How to add custom fonts to an iPhone app?
how to use custom font in iphone application
Can I embed a custom font in an iPhone application?
I hope these links help.

Related

custom fonts is not work in my iOS app [duplicate]

This question already has answers here:
Custom font is not working in my App?
(8 answers)
Closed 9 years ago.
Hai i have using already custom font ,But now i try to add font file it wont work properly ,i will try to use angry bird font file to add my application its not working.Remaining font file also not supporting i don't know i am doing correctly r not.My reference links http://refactr.com/blog/2012/09/ios-tips-custom-fonts/
https://wiki.appcelerator.org/display/guides/Custom+Fonts#CustomFonts-Sampleapp
Custom Fonts are easy as pie in iOS. If you use the Approach from http://refactr.com/blog/2012/09/ios-tips-custom-fonts/ like in your question you are read to go. But there is a really great difference in the font family name that you get from the font explorer from OSX and the actual family name in iOS.
You can get the family name via [UIFont familyNames] in your code. Now you have a Family name. Log this to your console via NSLog and then simply use [UIFont fontNamesForFamilyName:#"the_family_name_of_the_font"].
More information for familyNames and fontNamesForFamilyName:
Here are the steps transcribed:
1) Add your custom font files into your project using Xcode as a resource
2) Add a key to your Info.plist file called Fonts provided by application.
3) Make this key an array
4) For each font you have, enter the full name of your font file (including the extension) as items to the Fonts provided by application array
5) Save Info.plist
Now in your application you can simply call
[myLabel setFont:[UIFont fontWithName:#"Swis721 Lt BT" size:[lbl minimumFontSize]]]; //use font name not file name.

UITextField font style not changing

I have the following problem - I want to change the UITextField font to a custom one. I am using this line of code:
textField.font = [UIFont fontWithName:#"fontname.ttf" size:20];
I want to use this font:
Neurm.ttf
Can you please tell me what is wrong or just try it out and tell me is it working?
You doing wrong Because no need to set extension (fontname.ttf) in your string.
textField.font = [UIFont fontWithName:#"NEURM TTF" size:20];
and check following links how to use custom font in ios.
1.How to use custom font in iOS Apps?
2.iPhone Development: how to use custom fonts?
Its possible you may have not gone through some necessary steps to embed a custom font in your app.
Check;
iOS Custom Fonts
Can I embed a custom font in an iPhone application?
and see if you missed anything.
here
someTf.font = [UIFont fontWithName:#"AlexBrush-Regular" size:20];
This is working correctly no need to give .ttf ext

How to load font family in iphone

I want to use separate font styles for iphone.
So, need to load font family.
How to load font family in iphone.
Can anyone please..
drag and drop your customFontName.ttf file to your project
Goto projectname-info.plist in supporting files. Add a key Fonts provided
by application -> add new item -> give value customFontName.ttf
use it where ever you want as,
myLabel.font = [UIFont fontWithName:#"customFontName" size:15.0];
Try this link.you shall get through

Custom font in interface builder [duplicate]

This question already has answers here:
Using custom fonts in interface builder
(6 answers)
Closed 9 years ago.
I want to install custom font and used in UIlabel from ibterface builder,xcode4.2?I tried the Google ways but its not showing in the Interface builder?
Add the font file in your project and use the following to set the font.
self.font = [UIFont fontWithName:#"yourFontName" size:yourFontSize];
First save your custom font file in your project folder and then you have to add it to Your_Project_name-Info.plist file which might be located in your supporting files folder
click on Your_Project_name-Info.plist
Add new object(array)=>type Fonts provided by application on key field.
Add an object in that array with name of your font
As of now, Xcode 4.6, you cannot have Interface Builder display a custom font that it did not already come with. In order to have a label use a custom font you will have to display it programmatically. Which means that you will be unable to use IB to determine how long to make a label or anything like that.

Use customized font in iphone app, failed to launch the simulator!

I want to apply my customized font in iPhone app. So I did as these steps,
add customized.ttf into Xcode project/Resources
add "Fonts provided by application" in plist with a pair of key/value like this - item 0/customized.ttf
update font of label's text like this - lable.font = [UIFont fontWithName:#"customized" size:17];
But, it doesn't work... The simulator failed to launch. Am I wrong with any step? Could some friends help me about using customized font in iPhone app (support 3.x and 4)? Thanks in advance.
Linkou Bian
Email/MSN: linkou.bian#gmail.com