Get font Typeface from ttf file - Android Graphics

Android examples for Graphics:Font

Description

Get font Typeface from ttf file

Demo Code


//package com.java2s;

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

public class Main {
    public static Typeface getRobotoLight(Context context) {
        return Typeface.createFromAsset(context.getAssets(),
                "robotolight.ttf");
    }// w  w w. j a  v a  2s . c  om
}

Related Tutorials