Back to project page TypeFaceTextView.
The source code is released under:
MIT License
If you think the Android project TypeFaceTextView 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 com.nubicz.customviews; //from ww w. j av a2s. co m import java.util.HashMap; import android.content.Context; import android.graphics.Typeface; public class TypeFaceCache { public static HashMap<String,Typeface> pCache = null; public static Typeface getFont(Context context,String path){ if(pCache == null){ pCache = new HashMap<String, Typeface>(); } if(pCache.get(path) == null){ Typeface tf = Typeface.createFromAsset(context.getAssets(),path); pCache.put(path,tf); } return pCache.get(path); } }