Code example for Typeface

Methods: create

0
    public TextProperties(String string) {
	if (string.length() == 0 || string.equals("")
		|| string.equalsIgnoreCase("null") || string.equals("0")) {
	    mColor = Color.BLACK;
	    mSize = 24;
	    mTypeface = Typeface.create(Typeface.DEFAULT, Typeface.NORMAL);
	} else { 
	    String[] params = string.replace("|", "::").split("::");
	    mColor = Color.parseColor(params[0]);
	    mSize = Integer.parseInt(params[3]);
	    style = Integer.parseInt(params[2]);
	    mTypeface = Typeface.create(params[1].trim().toLowerCase(),
		    Integer.parseInt(params[2].trim()));
	} 
    } 
 
    public int getColor() { 
	return mColor;
    }