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
Related
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.
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
I wanna create my iPhone app in three languages. English & Punjabi & Gujarai.
"Gujarati" & "Punjabi" is not available in locale list of languages. so i can't able to create values folder like values-fr(french) and value-rs(russia).. like dat.. How can i develop this app with "Punjabi" & "Gujarati"?
IOS 4.3 onwards these fonts are supported : http://iosfonts.com/
If don't find the fonts then you can use custom fonts. Steps listed below
Just follow these steps:
1.Add your custom font files into your project using XCode as a resource
2.Add a key to your info.plist file called UIAppFonts.
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 UIAppFonts array
5.Save info.plist
6.Now in your application you can simply call [UIFont fontWithName:#"CustomFontName" size:12] to get the custom font to use with your UILabels and UITextViews, etc…
I installed a custom font called "modern no. 20" (already installed in my mac) into my iphone project .
I copied the modernno20.ttf into my resources.
Now in my app-info.plist i added this font name in "Fonts provided by application".
Then i added
cell.textLabel.font=[UIFont fontWithName:#"modernno20.ttf" size:14.0];
in my tableviewcode .
i dont know why but this font is not properly displayed.is there any thing i missed?
In order to call the font in your fontWithName call, the string should be the name of the font as it is displayed in the Mac's 'Font Book' app, and not the actual filename of the referenced font file.
There hasn’t been an easy way to add custom fonts to your iPhone applications. As of iOS 4 it has become very easy to do. there could be possibility you would have missed some of the step to get custom font work.
Here is what you need to do in order to add custom fonts,
Check How to include ttf fonts to iOS app
I added a font file (.ttf) to my Xcode project, to resources. Also, I added it to the UIAppFonts in my info.plist.
When I want to use this font though, I don't even see it as a choice in IB.
After installing the font on my system, I started seeing it in IB, but still - changing to it doesn't change anything - some default system font is displayed in the Interface Builder as well as in iPhone emulator.
Are there any steps more I should do to be able to use my own font?
To use custom fonts with iOS you have to set them programmatically.
For example, suppose you have a font file called swellfont.ttf that you add to your project.
You then would go into your App-Info.plist file and add the full name of the file to the next index of the array keyed by UIAppFonts, as you mention.
<key>UIAppFonts</key>
<array>
<string>swellfont.ttf</string>
</array>
Then, to use the font:
label.font = [UIFont fontWithName:#"swellfont" size:12];
Assuming that label is a UILabel and that swellfont.ttf is not protected. It's important to note that UIFont's fontWithName is not referring to the filename, instead its wanting the actual name of the font. If you open the font with FontForge you can see this information by selecting Element > Font Info from the menu bar. There are probably cleverer ways to find this information out.
I use 2 fonts in an APP. The first one was automatically added to the "Copy Bundle Resources", the other was not. I had to add that one myself.
Call in code:
[labelName setFont:[UIFont fontWithName:#"OneGreatBigFont" size:40]];