Use custom font for label?
Okay, I've followed all of the steps I could find for this:
- Converted my font to OpenType (.otf)
- Copied the font file to the 'Resources' directory
- Added the following code the the 'info.plist.template' file in 'Resources/iphone' directory:
<key>UIAppFonts</key> <array> <string>HelveticaCondensedBold.otf</string> </array>
- Set the fontFamily property for my label with this code:
var makeLabel = Ti.UI.createLabel({ font:{fontFamily:"HelveticaCondensedBold",fontSize:60}, color:"#2d2e2f", top:0, right:60, textAlign:"right", text:"2009 VOLKSWAGEN" });
But it doesn't work. The label just displays in the default font. Any ideas why?
12 Answers
-
On the bug report for this, Jeff Haynie from Appcelerator posted an update to the blog post where he introduced custom fonts.
Supposedly if you copy your info.plist from:
/YourAppRoot/build/iphone/info.plist
to:
/YourAppRoot/info.plist
…it will work. Unfortunately I still can't get it to work even after doing this. Can anyone pull it off with that tip?
-
This thread here worked for me:
http://developer.appcelerator.com/question/49151/custom-font-solutionApparently you'll have to delete the contents in your build folder, and do a complete rebuild
-
I got it working using this dirty workaround
-
-
i get the same thing man. No idea. Super frustrating!
-
Yep, and this (and many other issues) is why I would never in a million years consider paying for their outrageously priced professional subscriptions. Get the free version working first before you start trying to charge people. I've yet to be able to write a single working app with Titanium, since no matter what, I eventually run into some crippling bug, limitation or deficiency.
-
Just wanted to chime in since I'm having the same issue. I followed the instructions here, which it looks like you did also, and it doesn't work.
-
-
-
I have to say, while I admire what the Ti guys are trying to achieve, they need to concentrate on fixing the bugs in existing features and ensuring that basic functionality (such as the one raised in this thread) is provided before embarking on new complex features.
-
Having to bail on this issue for now, hope it can be addressed before i have to use images for a timer. :S
Help!
-
make sure your font file has estension in lower case (.otf and not .OTF)