how to get default Typeface of Android device?
i has API class inside my application inside Api class there is custom
font has been setup as static for example
public static Typeface font_short;
@SuppressWarnings("deprecation")
public Api(Context c , Display d)
{
this.context = c ;
//i want to change this if user want to keep using System font style
or my custome style
if ( keep_curren == true )
{
font_title = //What to add here to get Default fonts Typeface
}else
//use my costume font
{
font_title =
Typeface.createFromAsset(context.getAssets(),"fonts/custome.ttf");
}
display = d;
w = display.getWidth(); // deprecated
h = display.getHeight(); // deprecated
}
i want to get default and current Typeface of device if user don't want to
use my costume font !
in Activity Class
TextView blaaa = (TextView) findViewById(R.id.blaaa);
//change to custome font style or keep current font style
blaaa.setTypeface(Api.font_title);
and ideas ?
No comments:
Post a Comment