-6

I was trying to set Greek text to my Android Button view programatically but for Button views only it is not setting. It is taking a similar kind of English font.

But the same Greek text is setting to TextViews, the problem only with the Buttons.

<Button
    android:id="@+id/btnSubmitMobileNo"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Υποβολή"
     />
Hari Enaganti
  • 359
  • 1
  • 4
  • 12

1 Answers1

0

I use this Library and it works superb on all devices

Step:-

1) Add this line in your gradle compile 'com.github.balrampandey19:FontOnText:0.0.1'

2) Add your font in asset folder like this

3) Then replace your view in xml with

<com.balram.library.FotTextView
                    android:id="@+id/vno_tv"
                    .
                    .
                    android:textSize="14sp"
                    app:font="regular.ttf" />

this line is important to set custom font you want app:font="regular.ttf"

You can do same for Buttons Edittext

OR

If you want to use same "Font" through whole application you can follow this Guide here

Akshay Katariya
  • 1,464
  • 9
  • 20