public final class TypefaceUtils
extends java.lang.Object
Typeface avoiding the leak of the font when loaded
by multiple calls to Typeface.createFromAsset(android.content.res.AssetManager, String)
on pre-ICS versions.
More details can be found here https://code.google.com/p/android/issues/detail?id=9904
Created by Chris Jenkins on 04/09/13.
| Modifier and Type | Method and Description |
|---|---|
static CalligraphyTypefaceSpan |
getSpan(android.graphics.Typeface typeface)
A helper loading custom spans so we don't have to keep creating hundreds of spans.
|
static boolean |
isLoaded(android.graphics.Typeface typeface)
Is the passed in typeface one of ours?
|
static android.graphics.Typeface |
load(android.content.res.AssetManager assetManager,
java.lang.String filePath)
A helper loading a custom font.
|
public static android.graphics.Typeface load(android.content.res.AssetManager assetManager,
java.lang.String filePath)
assetManager - App's asset manager.filePath - The path of the file.Typeface or null if the path is invalid.public static CalligraphyTypefaceSpan getSpan(android.graphics.Typeface typeface)
typeface - not null typefacepublic static boolean isLoaded(android.graphics.Typeface typeface)
typeface - nullable, the typeface to check if ours.