Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Password Hint text does not have correct font applied

See original GitHub issue

If i try to use calligraphy for a password field as such:


It seems that the inputType attribute is forcing the hint into being monospaced (which seems to be odd, but normal android behavior with EditText). In this case, the font being applied by the style is ignored. Presumably because it is applied prior to android applying the inputType, and thus the typeface is getting overriden.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:4
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

QiiqeAzuaracommented, Oct 11, 2016

@here @mattinger I try this way:

1.- remove android:inputType=“textPassword” from xml 2.- apply typeface using this great library @chrisjenx thanks 3.- set passwordtransformation in code: password.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); // No suggestions password.setTransformationMethod(PasswordTransformationMethod.getInstance());


fingertrickscommented, Sep 7, 2015

@Sanjay-F if you use TextView.setInputType() with any of:


…then Android applies a Monospace typeface.

Note: you need to bitwise OR the above variations with the appropriate:


…when calling TextView.setInputType() otherwise Android doesn’t change the transformation type.

If for example you are using a button to toggle a password to be visible or not, you’ll have to manually set the Typeface after each call to setInputType() if you want to apply a custom Typeface. When toggling password visibility Android appears to reset the cursor position to the start of the EditText, so this snippet also sets the cursor to the end of the EditText.

mCheckbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
            mPassword.setInputType(InputType.TYPE_CLASS_TEXT | type);
Read more comments on GitHub >

github_iconTop Results From Across the Web

Password hint font in Android - Stack Overflow
I acquired the custom typeface from username EditText and applied it to TextInputLayout of the password field. Now you don't need to set...
Read more >
<input type="password"> - HTML: HyperText Markup Language
If the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. Note: Use ......
Read more >
Don't Use The Placeholder Attribute - Smashing Magazine
For someone who has never encountered it before, placeholder text may look like entered content, causing them to skip over the input. If...
Read more >
Working with the EditText | CodePath Android Cliffnotes
The EditText is the standard text entry widget in Android apps. ... If you do not see these styles applied within a DialogFragment,...
Read more >
ion-input: Custom Input Value Type Styling and CSS Properties
Types​. The input component is meant for text type inputs only, such as "text" , "password" , "email ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found