What is the best way of installing new font to android emulator?

Whenever android fails to find a specific character it looks to DroidSansFallback.ttf, so what you need to do is replace the DroidSansFallback.ttf of the emulator by renaming a ttf font of your required language to DroidSansFallback.ttf. Do the following steps. 1.Get a market enabled rooted android emulator. You can find one here: Rooted Market Enabled … Read more

Android sp vs dp texts – what would adjust the ‘scale’ and what is the philosophy of support

It is exposed in the settings menu on some Android devices (manufacturer dependent). It may also be altered by some accessibility options (device-dependent). In general, you should always used scale-independent pixels, especially for a large body of text. However if your text has to fit into a bounding-box of known size then you should use … Read more

Change the font of tab text in android design support TabLayout

If you are using TabLayout and you want to change the font you have to add a new for loop to the previous solution like this: private void changeTabsFont() { ViewGroup vg = (ViewGroup) tabLayout.getChildAt(0); int tabsCount = vg.getChildCount(); for (int j = 0; j < tabsCount; j++) { ViewGroup vgTab = (ViewGroup) vg.getChildAt(j); int … Read more

How to add external fonts to android application

You need to create fonts folder under assets folder in your project and put your TTF into it. Then in your Activity onCreate() TextView myTextView=(TextView)findViewById(R.id.textBox); Typeface typeFace=Typeface.createFromAsset(getAssets(),”fonts/mytruetypefont.ttf”); myTextView.setTypeface(typeFace); Please note that not all TTF will work. While I was experimenting, it worked just for a subset (on Windows the ones whose name is written in … Read more

How to set font custom font to Spinner text programmatically?

This is what worked for me (using ideas both from CommonsWare’s and gsanllorente’s answers): private static class MySpinnerAdapter extends ArrayAdapter<String> { // Initialise custom font, for example: Typeface font = Typeface.createFromAsset(getContext().getAssets(), “fonts/Blambot.otf”); // (In reality I used a manager which caches the Typeface objects) // Typeface font = FontManager.getInstance().getFont(getContext(), BLAMBOT); private MySpinnerAdapter(Context context, int resource, … Read more