Code example for Typeface

Methods: getStyle

0
        int oldStyle;
        Typeface old = paint.getTypeface();
        if (old == null) {
            oldStyle = 0;
        } else { 
            oldStyle = old.getStyle();
        } 
 
        int fake = oldStyle & ~tf.getStyle();
        if ((fake & Typeface.BOLD) != 0) {
            paint.setFakeBoldText(true);
        } 
 
        if ((fake & Typeface.ITALIC) != 0) {
            paint.setTextSkewX(-0.25f);
        } 
 
        paint.setTypeface(tf);
    } 
}