Android Utililty Methods Typeface Create

List of utility methods to do Typeface Create

Description

The list of methods to do Typeface Create are organized into topic(s).

Method

voidsetTypeface(Context context, String font, int style, TextView... textViews)
Sets a determined font on a text view element
Typeface tf = Typeface.createFromAsset(context.getAssets(), font);
for (TextView txt : textViews) {
    txt.setTypeface(tf, style);
voidsetTypeface(Context context, String font, TextView... textViews)
Sets a determined font on a text view element
Typeface tf = Typeface.createFromAsset(context.getAssets(), font);
for (TextView txt : textViews) {
    txt.setTypeface(tf);
voidsetTypeface(Context context, String font, Button... buttons)
Sets a determined font on a button element view
Typeface tf = Typeface.createFromAsset(context.getAssets(), font);
for (Button txt : buttons) {
    txt.setTypeface(tf);
voidsetTypeface(Context context, String font, int style, Button... buttons)
Sets a determined font on a text view element
Typeface tf = Typeface.createFromAsset(context.getAssets(), font);
for (Button txt : buttons) {
    txt.setTypeface(tf, style);
voidsetTypeface(Context context, String font, int style, ViewGroup group)
Sets a determined font on a text view element
Typeface tf = Typeface.createFromAsset(context.getAssets(), font);
int count = group.getChildCount();
View v;
for (int i = 0; i < count; i++) {
    v = group.getChildAt(i);
    if (v instanceof TextView)
        ((TextView) v).setTypeface(tf, style);
    else if (v instanceof ViewGroup)
...
voidsetTypeface(Context context, String font, ViewGroup group)
Sets a determined font on a text view element
Typeface tf = Typeface.createFromAsset(context.getAssets(), font);
int count = group.getChildCount();
View v;
for (int i = 0; i < count; i++) {
    v = group.getChildAt(i);
    if (v instanceof TextView)
        ((TextView) v).setTypeface(tf);
    else if (v instanceof ViewGroup)
...
TypefacegetTypeface(Activity activity)
get Typeface
if (mTypeface == null) {
    mTypeface = Typeface.createFromAsset(activity.getAssets(),
            "fonts/DejaVuSans.ttf");
return mTypeface;