Code example for TextPaint

Methods: getTypeface, setTypeface

0
     *  
     * @attr ref android.R.styleable#TextView_typeface 
     * @attr ref android.R.styleable#TextView_textStyle 
     */ 
    public void setSwitchTypeface(Typeface tf) {
        if (mTextPaint.getTypeface() != tf) {
            mTextPaint.setTypeface(tf);
 
            requestLayout();
            invalidate();
        } 
    } 
 
    /** 
     * Returns the text displayed when the button is in the checked state. 
     */ 
    public CharSequence getTextOn() {
        return mTextOn;
    } 
 
    /**