TypefaceHelper icon indicating copy to clipboard operation
TypefaceHelper copied to clipboard

Fetching a Typeface from the TypefaceCache

Open cioraneanu opened this issue 8 years ago • 3 comments

This library is great. However there are scenarios where you can set a widget's font only via its public methods.

ex. public void setValueTypeface(Typeface tf)

It would be great to have a method in TypefaceHelper that just returns the Typeface for a String resource.

cioraneanu avatar Mar 15 '16 09:03 cioraneanu

@cioraneanu I wasn't able to understand the use case yet. Are these third-party widget libraries? If so, I guess we could broaden the visibility of our TypefaceCache or add a method on the helper to get it from TypefaceCache.

jfsso avatar Mar 15 '16 23:03 jfsso

@jfsso Exactly. Charting libraries, or any view that draws its content via the Canvas API(with custom typeface setters) falls into this category.

I think it would be better to have a method in TypefaceHelper that returns mCache.get(typefaceName) instead of juggling with instances of TypefaceHelper and TypefaceCache separately.

cioraneanu avatar Mar 16 '16 06:03 cioraneanu

This is released as TypefaceHelper 1.2.0!

KeithYokoma avatar Mar 25 '16 08:03 KeithYokoma