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) {
}
}
}
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;
}
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);
}
}
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);
}
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;
}
Aggregations