Search in sources :

Example 66 with Typeface

use of android.graphics.Typeface in project mobile-android by photo.

the class ButtonCustomFont method setCustomFont.

protected void setCustomFont(String fontname) {
    if (null != fontname) {
        try {
            Typeface font = TypefaceUtils.createFromAsset(getContext().getAssets(), fontname);
            setTypeface(font);
        } catch (Throwable t) {
        }
    }
}
Also used : Typeface(android.graphics.Typeface)

Example 67 with Typeface

use of android.graphics.Typeface in project MaterialNavigationDrawer by neokree.

the class TypefaceManager method getTypeface.

private Typeface getTypeface(final String filename) {
    Typeface typeface = mCache.get(filename);
    if (typeface == null) {
        typeface = Typeface.createFromAsset(mAssetManager, "fonts/" + filename);
        mCache.put(filename, typeface);
    }
    return typeface;
}
Also used : Typeface(android.graphics.Typeface)

Example 68 with Typeface

use of android.graphics.Typeface in project plaid by nickbutcher.

the class FontUtil method get.

public static Typeface get(Context context, String font) {
    synchronized (sTypefaceCache) {
        if (!sTypefaceCache.containsKey(font)) {
            Typeface tf = Typeface.createFromAsset(context.getApplicationContext().getAssets(), "fonts/" + font + ".ttf");
            sTypefaceCache.put(font, tf);
        }
        return sTypefaceCache.get(font);
    }
}
Also used : Typeface(android.graphics.Typeface)

Example 69 with Typeface

use of android.graphics.Typeface in project Android-Switch-Demo-pre-4.0 by pellucide.

the class MySwitch method setSwitchTypefaceByIndex.

private void setSwitchTypefaceByIndex(int typefaceIndex, int styleIndex) {
    Typeface tf = null;
    switch(typefaceIndex) {
        case SANS:
            tf = Typeface.SANS_SERIF;
            break;
        case SERIF:
            tf = Typeface.SERIF;
            break;
        case MONOSPACE:
            tf = Typeface.MONOSPACE;
            break;
    }
    setSwitchTypeface(tf, styleIndex);
}
Also used : Typeface(android.graphics.Typeface)

Example 70 with Typeface

use of android.graphics.Typeface in project android-demos by novoda.

the class TagsView method hintStyle.

private int hintStyle() {
    Typeface tf = getTypeface();
    int style = Typeface.NORMAL;
    if (tf != null) {
        style = tf.getStyle();
    }
    return style;
}
Also used : Typeface(android.graphics.Typeface)

Aggregations

Typeface (android.graphics.Typeface)266 Paint (android.graphics.Paint)57 TextPaint (android.text.TextPaint)40 TypedArray (android.content.res.TypedArray)34 TextView (android.widget.TextView)21 View (android.view.View)20 Canvas (android.graphics.Canvas)15 Bitmap (android.graphics.Bitmap)13 Context (android.content.Context)11 Resources (android.content.res.Resources)10 Test (org.junit.Test)8 ColorStateList (android.content.res.ColorStateList)7 Legend (com.github.mikephil.charting.components.Legend)7 File (java.io.File)7 Intent (android.content.Intent)6 Attributes (com.cengalabs.flatui.Attributes)6 XAxis (com.github.mikephil.charting.components.XAxis)6 YAxis (com.github.mikephil.charting.components.YAxis)6 ContentResolver (android.content.ContentResolver)5 Drawable (android.graphics.drawable.Drawable)5