I was wondering, what are the advantages (besides having a differenciating font) and making using it according the the trademark of a product of using a custom font?
But more important, what are the real disadvantages? I read in this answer https://stackoverflow.com/a/4734610/327011 that at least OTF has problems, some of which manifestat even more in specific devices according to the PPI.
So, for those who have use and those who don't because they don't think they should, what are your opinions and arguments?
Thanks
In addition to the downsides cited by the existing answers, also consider:
- you need a font that you are legally allowed to distribute
- you need a font that has all the right glyphs for all the languages you intend to support (not all fonts do)
- in my experience, Android can't handle every font and quietly falls back to Droid Sans for those it does not support, so you will need to test your font to ensure it actually works
There's a known bug in Android 2.1 where WebView
does not display custom fonts (specified via CSS @font-face).
Also, fonts are big and grow the APK considerably. The low-bandwidth and pay-per-bandwidth users will hate you.
You include a custom font to make your app look pretty, stand out from the crowd, conform to some brand identity etc. Also, packaging your own font gives you ultimate control. Manufacturers are free to change the standard themes (including fonts) for their own skins e.g. HTC Sense, Samsung TouchWiz etc).
The only real downsides are that you must include the custom font within your apk (which adds to the download size) and that you need boilerplate code in every activity that uses your custom font (i.e. you cannot simply assign your custom font to a textview/edittext etc via xml).
Older versions of Android (i.e. <1.6) may not support your font but as of today that's <0.6% of the market. http://developer.android.com/resources/dashboard/platform-versions.html
Besides what CommonsWare said, (that was my first accepted answer), I have found a major bug, that creates memory leaks when using Custom Fonts:
http://code.google.com/p/android/issues/detail?id=9904#c7
Because of this, I tend to think that it is not a good ideia to use them.. or at least beware when you use them!
If you do need to use them, you can use this to avoid the biggest part of the memory leaks:
public class Typefaces {
private static final String TAG = "Typefaces";
private static final Hashtable<String, Typeface> cache = new Hashtable<String, Typeface>();
public static Typeface get(Context c, String assetPath) {
synchronized (cache) {
if (!cache.containsKey(assetPath)) {
try {
Typeface t = Typeface.createFromAsset(c.getAssets(),
assetPath);
cache.put(assetPath, t);
} catch (Exception e) {
Log.e(TAG, "Could not get typeface '" + assetPath
+ "' because " + e.getMessage());
return null;
}
}
return cache.get(assetPath);
}
}
}