Can you set a custom font from XML? As far as I’ve managed to find, the answer is no.
So instead, how do you do this programatically?
First start by creating an ‘assets’ folder in your project, within this create a folder called ‘fonts’. ‘assets’ should be on the same level as ‘res’ and not within it. Drag your font file in here. Need a font? Lots of free, open source ones available here: http://www.google.com/webfonts/v2.
Setting the font on a View couldn’t be simpler, here’s an example using the Lobster font from Google webfonts
If needing to set the font in a list item, I load the font to a member variable within the constructor of my ListAdapter so that it can be used in my overridden newView() rather than loading it every time.
Specimen Hunter is a capture logging app to help UK & European coarse anglers keep track of their specimen targets and personal bests. Ideal if you are into specimen fishing, from Pike and Perch to Carp, Barbel and Roach.