Ok so I have research this and found some code relating to the topic but it doesn't seem to work when I try. I have been individually had to change the font for each text view and it's driving me insane. What I have done so far is create a class that will overide the font:
public final class FontsOverride {
public static void setDefaultFont(Context context,
String staticTypefaceFieldName, String fontAssetName) {
final Typeface regular = Typeface.createFromAsset(context.getAssets(),
fontAssetName);
replaceFont(staticTypefaceFieldName, regular);
}
protected static void replaceFont(String staticTypefaceFieldName,
final Typeface newTypeface) {
try {
final Field staticField = Typeface.class
.getDeclaredField(staticTypefaceFieldName);
staticField.setAccessible(true);
staticField.set(null, newTypeface);
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
And then each time I wish to overide the font in each class I tried to implemnt this:
FontsOverride.setDefaultFont(this, "DEFAULT", "ComicRelief.ttf");
There has to be simple way to do this I've been trying for hours and just can't get my head around it.