Custom fonts on Android in TitaniumStudio

You must Login before you can answer or comment on any questions.

Is there a way to use custom fonts in an Android application, using Titanium Mobile SDK 1.7 (RC1)? I managed to use a custom font in the iPhone version, but it doesn't work on Android.

2 Answers

Accepted Answer

— answered 2 years ago by Don Thorp
answer permalink
5 Comments
  • Indeed it worked on Android, but now it doesn't work anymore on iPhone. Any suggestions on how to make it work simultaneously on both platforms?

    Thank you!

    — commented 2 years ago by Bogdan Irimia

  • I know this is old but did you ever find a solution to use custom fonts cross platform?

    — commented 2 years ago by Daniel Mahon

  • Just drop your custom font files in the Resources folder for iOS & Resources/android/fonts for Android.

    Then you'll have to do some device detection in your code as Android & iOS expect the fontFamily name in slightly different formats. iOS the Font Family Name, Android the file name of the font.

    So you'd do something like below which is using my own custom device helper file but you can do all this using Ti.UI.Platform

    if(device.isiPhone()){
       lblViewTitle.font = {fontSize:50, fontFamily:"Doctor Soos Bold"};
    } else if (device.isAndroid()) {
       lblViewTitle.font = {fontSize:34, fontFamily:"doctorsoos"};
    }

    — commented 1 year ago by David Hudson

  • Show 2 more comments

Your Answer

Think you can help? Login to answer this question!