Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to retrieve a list of available/installed fonts in android?

In Java I would do something like:

java.awt.GraphicsEnvironment ge =                        java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(); Font[] fonts = ge.getAllFonts();  

is there an Android equivalent?

like image 764
ab11 Avatar asked Aug 20 '10 15:08

ab11


People also ask

Where are fonts stored on Android?

Sytem fonts are kept in the fonts folder under system. > /system/fonts/> is the exact path and you find it by going to "file system root" from the top folder that you can reach where your choices are sd card -sandisk sd card (if you have one in the sd card slot.

What fonts are available in Android?

There are only three system wide fonts in Android; 1 normal (Droid Sans), 2 serif (Droid Serif), 3 monospace (Droid Sans Mono).


1 Answers

Taken from Mark Murphy's answer on the Android Developers mailing list:

http://developer.android.com/reference/android/graphics/Typeface.html

There are only three fonts: normal (Droid Sans), serif (Droid Serif), and monospace (Droid Sans Mono).

While there may be additional fonts buried in WebKit somewhere, they appear to be inaccessible to developers outside of WebKit. :-(

The only other fonts are any TrueType ones you bundle with your application.

Edit: Roboto is a new font which came in with Android 4.0. You can use this library project to use it in all versions back to API level 4 https://github.com/mcalliph/roboto-text-view

like image 157
matto1990 Avatar answered Sep 21 '22 17:09

matto1990