Pallavi
Pallavi

Reputation: 674

how to get android default font list programmatically?

I am trying to create app which provide text formatting (like font style , font size , font color). So I want default fonts provided by android as a list to be shown in drop-down. Selecting font from drop-down will change the Text dynamically. Can anyone help , how can I achieve this either via XML or programmatically ?

See the image how it must look like

enter image description here

Upvotes: 8

Views: 4690

Answers (2)

liao
liao

Reputation: 156

font list is saved in Typeface class as a static field Map<Stirng, Typeface> sSystemFontMap. you just need to get this field. See my answer here.

Upvotes: 3

Sathish Kumar J
Sathish Kumar J

Reputation: 4345

There are only three system wide fonts in Android SDK.

  • normal

  • serif

  • monospace

More info : click here

Upvotes: 2

Related Questions