2

Im trying to apply typeface to textviews and editTexts but the typeface silently fails with no error or exception in logs.There is no change in font and android default font is shown.

I have tried around 10 fonts nothing works(otf & ttf both) nothing worked

I also tried to convert it http://www.freefontconverter.com/ here as some answers suggested. But, still not working.

 typefaceLight = Typeface.createFromAsset(getAssets(), "fonts/MyriadProRegular.otf");
//        typefaceBold = Typeface.createFromAsset(getAssets(), "fonts/HNBold.otf");
//                typefaceBold = Typeface.createFromAsset(getAssets(), "fonts/Helvetica.ttf");
        typefaceBold = Typeface.createFromAsset(getAssets(), "fonts/HelveticaBold.ttf");
        typefaceLight = Typeface.createFromAsset(getAssets(), "fonts/HelveticaLight.ttf");
        typefaceArialBold = Typeface.createFromAsset(getAssets(), "fonts/helveticabold1.ttf");
//        typefaceLight = Typeface.createFromAsset(getAssets(), "fonts/HNLight.otf");
        registerTitleTv.setTypeface(typefaceBold);
        signInTittleTv.setTypeface(typefaceBold);
        termsSiginTextView.setTypeface(typefaceLight);
        termsSignUpTextview.setTypeface(typefaceLight)

enter image description here

I have referred to

Custom Fonts not working in lollipop?

Custom Font not working on Android

Changing the android typeface doesn't work

https://code.google.com/p/android/issues/detail?id=61771

Android 5.0 (API 21) fails to render custom fonts / typefaces

Is there something wrong with my code?

Community
  • 1
  • 1
Rachita Nanda
  • 4,509
  • 9
  • 42
  • 66

1 Answers1

0

your code seems fine . I would suggest you either clean your code or uninstall app and install again .

young_08
  • 1,196
  • 2
  • 13
  • 35