Back to project page clinicalguide.
The source code is released under:
Apache License
If you think the Android project clinicalguide listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.get.oxicam.clinicalguide.ui; /* w ww . ja va 2s . c o m*/ import android.content.Context; import android.graphics.Typeface; import android.util.AttributeSet; import android.util.Log; import android.widget.TextView; public class TextViewCustomFont extends TextView { private static final String TAG = "TextView"; public TextViewCustomFont(Context context) { super(context); } public TextViewCustomFont(Context context, AttributeSet attrs) { super(context, attrs); setCustomFont(context, "fontello.ttf"); } public TextViewCustomFont(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); setCustomFont(context, "fontello.ttf"); } public boolean setCustomFont(Context ctx, String asset) { Typeface tf = null; try { tf = Typeface.createFromAsset(ctx.getAssets(), asset); } catch (Exception e) { Log.e(TAG, "Could not get typeface: "+e.getMessage()); return false; } setTypeface(tf); setText(">"); return true; } }