Monday, November 4, 2013

How to add Custom font in Titanium also Bangla Support in android

This is the Easy way To add custom font  or support Bangla in your android apps in titanium.

At first create a folder named fonts in resource directory then past here your custom font. you can get it

And call this font in a font property where you want like this code.

var customFont = 'Spicy Rice'; // use the friendly-name on iOS
if(Ti.Platform.osname=='android') {
   // on Android, use the "base name" of the file (name without extension)
   customFont = 'SpicyRice-Regular';
} 

var label1 = Titanium.UI.createLabel({
   color:'#000',
   text:'I am Window 1',
   font:{
      fontSize:40,
      fontFamily: customFont
   },
   textAlign:'center',
   width:'auto'
});


You can follow this link Custom_Fonts to know more.
Thanks



No comments:

Post a Comment