set Font From Assets With Name for TextView - Android User Interface

Android examples for User Interface:TextView

Description

set Font From Assets With Name for TextView

Demo Code


//package com.java2s;
import android.content.Context;
import android.graphics.Typeface;
import android.widget.TextView;

public class Main {
    public static void setFontFromAssetsWithName(Context context,
            TextView textView, String assetFontName) {
        textView.setTypeface(Typeface.createFromAsset(context.getAssets(),
                assetFontName));//  ww  w.j av  a  2  s  . c  om
    }
}

Related Tutorials