get Default Typeface - Android Graphics

Android examples for Graphics:Font

Description

get Default Typeface

Demo Code


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

public class Main {
    private static Typeface appTypefaceZh;

    public static Typeface getDefaultTypeface(Context context) {
        return getTypefaceZh(context);
    }//from w  ww.  j a v  a2 s  . c o m

    public static Typeface getTypefaceZh(Context context) {

        if (appTypefaceZh == null) {
            appTypefaceZh = Typeface.createFromAsset(context.getAssets(),
                    "fonts/en53.otf");
        }
        return appTypefaceZh;
    }
}

Related Tutorials