Henrik Engdahl
Henrik Engdahl

Reputation: 121

Custom fonts wont work in android

Using Titanium studios; So i got this font in both my resource/fonts folder, android/fonts folder, root/assets/fonts; and I Cant find what I got wrong with my code. The only conclusion is that the font wont work with android at all. My teacher could'nt find the solution either.

I have searched long and hard but found nothing that helped yet.

http://pastie.org/8722990

Upvotes: 1

Views: 95

Answers (1)

Tim
Tim

Reputation: 528

The fontSize and fontFamily properties need to go in a font {} object, e.g.

var titel = Ti.UI.createLabel({
    text : "Hur låter..?",
    color : "white",
    textAlign : "center",
    bottom : "85%",
    font: { 
        fontSize : 45,
        fontFamily : 'customFont'
    }
});

http://docs.appcelerator.com/platform/latest/#!/api/Font

Upvotes: 2

Related Questions