Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.content.Context;
import android.graphics.Typeface;
import android.util.Log;
import android.widget.Toast;

public class Main {
    final static String TAG = "AwesomeWidgetUtils";
    private static String font_awesome = "fonts/fontawesome-webfont.ttf";

    /**
     * 
     * @param context
     * @return
     */
    public static Typeface getFAFont(Context context) {
        Typeface tf = null;
        try {
            tf = Typeface.createFromAsset(context.getAssets(), font_awesome);
        } catch (Exception e) {
            Log.e(TAG, "Failed to load FontAwesome Font");
            Toast.makeText(context, "Failed to load FontAwesome Font", Toast.LENGTH_SHORT).show();
        }
        return tf;
    }
}