Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Custom font solution

I made it my mission to get custom fonts to work. I wasn't particularly pleased with doing the "dirty," KitchenSink-shell method (it would often render the project useless and unrenderable). So, I finally found a way that reliably and continually works. Since it is mildly complicated, I made a video for you fine folks.

Note: I got it working with BOTH .ttf and .otf files. Also, I got it working on the phone itself (though I've not submitted it in an app yet).

I haven't tried this with an iPad project, but I suspect it would be the same process.

My specs:
MacBookPro 10.6.4;
iPhone 3G 4.0.1;
Titanium 1.2.1 with 1.4 SDK

— asked August 3rd 2010 by Rafael Hernandez
  • custom
  • fonts
  • iphone
2 Comments
  • Awesome, thanks so much, you're a life saver!

    — commented November 22nd 2010 by Daniel Feinsmith
  • Confirms that this works today, with SDK 4.1, Titanium 1.2.1.

    — commented December 2nd 2010 by Johnny Nilsson

14 Answers

  • Remember to delete the build folder after each time you add new font otherwise the change won't show up in your app.

    — answered December 15th 2011 by Stanislav Cmakal
    permalink
    0 Comments
  • Has anyone noticed this not working with SDK 4.2, Titanium 1.2.2? I've followed the video and even Jeff's blog post and I can see the font being recognized and included in the build but it never renders the font.

    Any ideas? Thx!

    — answered December 17th 2010 by Kelly Redd
    permalink
    0 Comments
  • oh THANK YOU, no other method worked for me. And yes, it is working for iPad too.

    — answered August 12th 2010 by Martin von Wysiecki
    permalink
    0 Comments
  • THANK YOU!!! This is perfect!

    — answered August 16th 2010 by Jeff Hampton
    permalink
    0 Comments
  • Great Work. Thank you for this!

    — answered August 17th 2010 by Jag Lavek
    permalink
    0 Comments
  • Custom font is crashing my app on 3G - 3.1.3

    iPad - 3.2.2 & 4G - 4.0.2 working

    My specs: MacBookPro 10.6.4 / Titanium 1.2.1 / 1.4 SDK

    — answered August 27th 2010 by Seb S.
    permalink
    1 Comment
    • I believe custom font support was added with Firmware 3.2 and higher. So yes, it will probably crash a < 3.2 phone.

      — commented August 29th 2010 by Rafael Hernandez
  • Great!

    — answered September 19th 2010 by matteo annibali
    permalink
    0 Comments
  • Great!

    — answered September 19th 2010 by matteo annibali
    permalink
    0 Comments
  • Hey,

    I got it working for iPhone. Thanks a ton.. But I need to get it on Android.. How do I get custom fonts in the form of ttf file to work on Android.

    Thanks

    — answered December 20th 2010 by Deeksha Prabhakar
    permalink
    0 Comments
  • This works perfectly. Thanks a ton!

    — answered January 29th 2011 by Rj S.
    permalink
    0 Comments
  • make sure your font filename has estension in lower case (.otf and not .OTF)

    — answered February 17th 2011 by Enrico Luciano
    permalink
    0 Comments
  • Totally works. Thanks for the video guide.

    — answered April 6th 2011 by Paul Voss
    permalink
    0 Comments
  • Worked just fine for me! Thanks!

    — answered April 10th 2011 by Chris Hoopes
    permalink
    0 Comments
  • works! awesome!

    — answered May 18th 2011 by Julius Francisco
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.