Is there a Typeface.createFromAsset () cache?

A simple question: Does Typeface.createFromAsset () have a cache? Or should I just keep the link in my memory to hold it in my hands? The reason I ask is because I use it quite a lot (all to support a single font in many actions / views), so I wonder if Typeface will do a simple caching bit, so I don’t need to support contact me .

+7
android typeface
source share
1 answer

This is not how I can say - it directly calls in

http://google.com/codesearch/p?hl=en#uX1GffpyOZk/core/jni/android/graphics/Typeface.cpp&l=115

which looks like it will always open Asset and create a new font for the stream. You can probably double check this yourself; just check and make sure you get the same Typeface object from multiple createMromAsset calls with the same asset.

+10
source share

All Articles