get Medieval Font - Android Graphics

Android examples for Graphics:Font

Description

get Medieval Font

Demo Code


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

public class Main {
    private static Typeface medievalFont;
    private static final Object lock = new Object();

    public static Typeface getMedievalFont(Context context) {
        synchronized (lock) {
            if (medievalFont == null)
                medievalFont = Typeface.createFromAsset(
                        context.getAssets(), "fonts/Cimbrian.ttf");
        }//w ww  .  j a va 2  s .co  m
        return medievalFont;
    }
}

Related Tutorials