medyo / Fancybuttons

Icons, Borders, Radius ... for Android buttons
1.77k stars 397 forks source link

Add a setCustomIconFont(Typeface fontName) method #67

Closed neoteknic closed 8 years ago

neoteknic commented 8 years ago

I have already loaded font, I want to be able to pass them directly to fancybutton. please add a setCustomIconFont(Typeface fontName) and setCustomTextFont(Typeface fontName) method. It remove multiple call to Typeface.createFromAsset, or change : private Typeface mTextTypeFace = null; private Typeface mIconTypeFace = null; to public

medyo commented 8 years ago

hi @neoteknic,

by using Fancybuttons Fonts Loader you take advantage of caching ! we do cache fonts to avoid performance issues.

If you've akready used a font for other views and you'd like to keep it for fancybuttons buttons too, just change the way you load font from Typeface.createFromAsset(context.getAssets(), fontPath) to Utils.findFont(context, fontName, null) (make sure Utils belongs to the package mehdi.sakout.fancybuttons)

Hope that answers your question