Code example for Typeface

Methods: getStyle

0
                tf = Typeface.create(tf, style);
            } 
 
            setSwitchTypeface(tf);
            // now compute what (if any) algorithmic styling is needed 
            final int typefaceStyle = tf != null ? tf.getStyle() : 0;
            final int need = style & ~typefaceStyle;
            mTextPaint.setFakeBoldText((need & Typeface.BOLD) != 0);
            mTextPaint.setTextSkewX((need & Typeface.ITALIC) != 0 ? -0.25f : 0);
        } else { 
            mTextPaint.setFakeBoldText(false);
            mTextPaint.setTextSkewX(0);
            setSwitchTypeface(tf);
        } 
    } 
 
    /** 
     * Sets the typeface in which the text should be displayed on the switch. 
     * Note that not all Typeface families actually have bold and italic 
     * variants, so you may need to use {@link #setSwitchTypeface(Typeface, int)} to get the appearance 
     * that you actually want.