private static void applyForView ( View view , TypefaceCollection typefaceCollection ) { if ( view instanceof TextView ) { TextView textView = ( TextView ) view ; Typeface oldTypeface = textView . getTypeface ( ) ; final int style = oldTypeface == null ? Typeface . NORMAL : oldTypeface . getStyle ( ) ; textView . setTypeface ( typefaceCollection . getTypeface ( style ) ) ; textView . setPaintFlags ( textView . getPaintFlags ( ) | Paint . SUBPIXEL_TEXT_FLAG ) ; } }
Apply typeface to single view