Back to project page npr-android-app.
The source code is released under:
Apache License
If you think the Android project npr-android-app listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.npr.android.util; //w w w. java 2s. c o m import android.content.Context; import android.graphics.Typeface; import java.util.HashMap; public class TypefaceCache { private static HashMap<String, Typeface> map = new HashMap<String, Typeface>(); public static Typeface getTypeface(String file, Context context) { Typeface result = map.get(file); if (result == null) { result = Typeface.createFromAsset(context.getAssets(), file); map.put(file, result); } return result; } }