2

These two snipets give me the same results. i am wondering if thats only because my device runs on android 4.2.2 or if the support library is doing something which means users from 11+ will also see it in robotolight.

My question is, if i used the first example below, will users on api 13 for example, also see the roboto-light font?

android:fontFamily="sans-serif-light"

.

 Typeface tf = Typeface.createFromAsset(
                    c.getAssets(), "Roboto-Light.ttf");
            tv.setTypeface(tf);
124697
  • 22,097
  • 68
  • 188
  • 315

1 Answers1

2

My question is, if i used the first example below, will users on api 13 for example, also see the roboto-light font?

No. The Roboto fonts are only natively available from Android 4.1 and upwards.

You have to set the typeface for versions lower than 4.1 like in your second example. Look up this answer I gave a while back for more information.

Community
  • 1
  • 1
Ahmad
  • 69,608
  • 17
  • 111
  • 137