custom font in android ListView

If you don’t want to create a new class you can override the getView method when creating your Adapter, this is an example of a simpleAdapter with title and subtitle: Typeface typeBold = Typeface.createFromAsset(getAssets(),”fonts/helveticabold.ttf”); Typeface typeNormal = Typeface.createFromAsset(getAssets(), “fonts/helvetica.ttf”); SimpleAdapter adapter = new SimpleAdapter(this, items,R.layout.yourLvLayout, new String[]{“title”, “subtitle” }, new int[] { R.id.rowTitle, R.id.rowSubtitle }){ … Read more

How to use a custom typeface in a widget?

What is needed is to render the font onto a canvas, and then pass it on to a bitmap and assign that to an ImageView. Like so: public Bitmap buildUpdate(String time) { Bitmap myBitmap = Bitmap.createBitmap(160, 84, Bitmap.Config.ARGB_4444); Canvas myCanvas = new Canvas(myBitmap); Paint paint = new Paint(); Typeface clock = Typeface.createFromAsset(this.getAssets(),”Clockopia.ttf”); paint.setAntiAlias(true); paint.setSubpixelText(true); paint.setTypeface(clock); … Read more