How to change letter spacing in a Textview?
Since API 21 there is an option set letter spacing. You can call method setLetterSpacing or set it in XML with attribute letterSpacing.
Since API 21 there is an option set letter spacing. You can call method setLetterSpacing or set it in XML with attribute letterSpacing.
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
Solution1:: Just call these method by passing parent view as argument. private void overrideFonts(final Context context, final View v) { try { if (v instanceof ViewGroup) { ViewGroup vg = (ViewGroup) v; for (int i = 0; i < vg.getChildCount(); i++) { View child = vg.getChildAt(i); overrideFonts(context, child); } } else if (v instanceof TextView … Read more
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
This bug of Android OS could be the reason of your issue: Typeface.createFromAsset leaks asset stream Where are also a workaround in this bugreport: I altered HTH’s workaround so that the method does not assume the font path or format. The full path of the font asset must be submitted as a parameter. I also … Read more
How to change fontFamily of TextView in Android