I am trying to use a custom font in a password hint field in Android Studio.
After I set the Edit Text as inputType="textPassword"
in XML, the font changes to a different from the one I've chosen. All the other Edit Texts have the correct custom font.
I've tried following this solution in java code (replaced Typeface.DEFAULT with R.font.my_font) but nothing happened
EditText password = (EditText) findViewById(R.id.register_password_text);
password.setTypeface(R.font.my_font);
password.setTransformationMethod(new PasswordTransformationMethod());
I've also tried this solution with no success
Typeface cache = edtPassword.getTypeface();
edtPassword.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
edtPassword.setTypeface(cache);
Any ideas on what to try or what might be missing in these solutions?
PS: I'm using montserrat_regular font