package com.sqisland.android.advanced_textview;

import android.app.Activity;
import android.graphics.Typeface;
import android.os.Bundle;
import android.widget.TextView;

public class CustomFontActivity extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_custom_font);

    TextView textView = (TextView) findViewById(R.id.text);
    Typeface typeface = Typeface.createFromAsset(getAssets(), "Ruthie.ttf");
    textView.setTypeface(typeface);
  }
}
@@ -71,16 +71,48 @@
 tivity;%0A
+import android.content.Context;%0A
 import a
@@ -194,16 +194,76 @@
 extView;
+%0Aimport android.view.View;%0Aimport android.util.AttributeSet;
 %0A%0Apublic
@@ -307,16 +307,47 @@
 ivity %7B%0A
+%0A  private Typeface typeface;%0A%0A
   @Overr
@@ -453,128 +453,438 @@
     
-setContentView(R.layout.activity_custom_font);%0A%0A    TextView textView = (TextView) findViewById(R.id.text
+typeface = Typeface.createFromAsset(getAssets(), %22Ruthie.ttf%22);%0A    setContentView(R.layout.activity_custom_font);%0A  %7D%0A%0A  @Override%0A  public View onCreateView(View parent, String name, Context context, AttributeSet attrs) %7B%0A    //this would apply to all textviews in the app%0A    if (name.equals(%22TextView%22)) %7B%0A      System.out.println(%22loading custom font%22);%0A      TextView view = new TextView(this, attrs
 );%0A    
+  
+view.set
 Typeface
  typ
@@ -879,25 +879,25 @@
 Typeface
- 
+(
 typeface
  = Typef
@@ -892,68 +892,333 @@
 face
- = Typeface.createFromAsset(getAssets(), %22Ruthie.ttf
+);%0A      return view;%0A    %7D%0A%0A    return super.onCreateView(parent, name, context, attrs);%0A  %7D%0A%0A  @Override%0A  public View onCreateView(String name, Context context, AttributeSet attrs) %7B%0A    //this would apply to all textviews in the app%0A    if (name.equals(%22TextView%22)) %7B%0A      System.out.println(%22loading custom font
 %22);%0A    
 text
@@ -1217,41 +1217,169 @@
     
+  
-textView.setTypeface(typeface);%0A  %7D%0A%7D
+TextView view = new TextView(this, attrs);%0A      view.setTypeface(typeface);%0A      return view;%0A    %7D%0A%0A    return super.onCreateView(name, context, attrs);%0A  %7D%0A%0A%7D%0A

Load the custom font in all textviews.