get FontAwesome - Android Graphics

Android examples for Graphics:Font

Description

get FontAwesome

Demo Code


//package com.java2s;

import android.content.Context;
import android.graphics.Typeface;

public class Main {
    /**//from  www  .  j  a v  a  2s. c om
     * fontawesome type face
     */
    private static Typeface mFontAwesome = null;

    /**
     * get FontAwesome
     * @param context activity context
     * @return
     */
    public static Typeface getFontAwesome(Context context) {
        if (mFontAwesome == null)
            mFontAwesome = Typeface.createFromAsset(context.getAssets(),
                    "fontawesome-webfont.ttf");
        return mFontAwesome;
    }
}

Related Tutorials