Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    public static Typeface getTypface(@Nullable String font_name, Context mContext) {
        if (font_name == null)
            return Typeface.DEFAULT;
        return Typeface.createFromAsset(mContext.getAssets(), "fonts/" + font_name);
    }
}