Example usage for android.graphics Typeface createFromFile

List of usage examples for android.graphics Typeface createFromFile

Introduction

In this page you can find the example usage for android.graphics Typeface createFromFile.

Prototype

public static Typeface createFromFile(@Nullable String path) 

Source Link

Document

Create a new typeface from the specified font file.

Usage

From source file:com.codegarden.nativenavigation.JuceActivity.java

public final Typeface getTypeFaceFromByteArray(byte[] data) {
    try {/*from  ww w  .  ja v  a 2 s .  c o m*/
        File f = getDataCacheFile(data);

        if (f != null)
            return Typeface.createFromFile(f);
    } catch (Exception e) {
        Log.e("JUCE", e.toString());
    }

    return null;
}

From source file:com.juce.JuceAppActivity.java

public final Typeface getTypeFaceFromByteArray (byte[] data)
{
    try/*from   w ww .  j av  a 2  s.  c o m*/
    {
        File f = getDataCacheFile (data);

        if (f != null)
            return Typeface.createFromFile (f);
    }
    catch (Exception e)
    {
        Log.e ("JUCE", e.toString());
    }

    return null;
}