-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ANDROID] fontFamily, fontStyle and fontWeight support for TextInput #6564
[ANDROID] fontFamily, fontStyle and fontWeight support for TextInput #6564
Conversation
Again, please update the TextExample to show this being used please. |
…79/react-native into pr/android-password-font-family
@brunobar79 updated the pull request. |
…79/react-native into pr/android-password-font-family
@brunobar79 updated the pull request. |
@brunobar79 updated the pull request. |
@dmmiller TextInputExample updated (see gif above). Also added support for fontWeight and fontStyle, which it's all related to TypeFace. If you think this is ok I'll do the same with the color PR |
@brunobar79 updated the pull request. |
Now that 2a2ba4b has landed, can you rebase since I think this uses the same example and then we can try landing this one? |
Do we not support font family/weight/style for normal text input? Or do we but because of the way secure entry works we need to do this additionally? |
@dmmiller You're right! There's no support for fontFamily, fontStyle or fontWeight on regular text inputs. I'm gonna rename this PR and make it for TextInput in general, and I'll update the examples. |
@bestander I just found the issue and finally got it working on android 4.4.2. It was crashing on view.getTypeface().getStyle() cause view.getTypeface() returns null when there's no fontFamily or style previously set on Android 4. Here you can see it working on android 4 and 6 after my last commit. |
} | ||
|
||
Typeface currentTypeface = view.getTypeface(); | ||
if(currentTypeface == null){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could you add spaces before and after ()
please
@brunobar79, great, thanks a lot. |
@bestander it should be good now. |
@brunobar79 updated the pull request. |
Travis build fail can be ignored, infra |
@facebook-github-bot shipit |
Thanks for importing. If you are an FB employee go to Phabricator to review. |
41e89b4
Summary: fontFamily, fontWeight and fontStyle properties are being ignored for TextInput. There's an additional issue that happens when you add secureTextEntry={true} it overrides the current font preferences (because it defaults to monospace) so we have to reapply it. Master right now: ![screen shot 2016-03-21 at 6 21 05 pm](https://cloud.githubusercontent.com/assets/1247834/13936110/c25ffea8-ef91-11e5-8d71-1b0a55184e24.png) Demo after the fix: ![5ux4bpjfwh](https://cloud.githubusercontent.com/assets/1247834/13935865/0f2ca8be-ef90-11e5-82c7-d5a2dd33b70e.gif) Closes facebook#6564 Differential Revision: D3081623 Pulled By: bestander fb-gh-sync-id: 329cac6755b5a0dd549e546768f39efa7b7f4daa fbshipit-source-id: 329cac6755b5a0dd549e546768f39efa7b7f4daa
Summary: fontFamily, fontWeight and fontStyle properties are being ignored for TextInput. There's an additional issue that happens when you add secureTextEntry={true} it overrides the current font preferences (because it defaults to monospace) so we have to reapply it. Master right now: ![screen shot 2016-03-21 at 6 21 05 pm](https://cloud.githubusercontent.com/assets/1247834/13936110/c25ffea8-ef91-11e5-8d71-1b0a55184e24.png) Demo after the fix: ![5ux4bpjfwh](https://cloud.githubusercontent.com/assets/1247834/13935865/0f2ca8be-ef90-11e5-82c7-d5a2dd33b70e.gif) Closes facebook#6564 Differential Revision: D3081623 Pulled By: bestander fb-gh-sync-id: 329cac6755b5a0dd549e546768f39efa7b7f4daa fbshipit-source-id: 329cac6755b5a0dd549e546768f39efa7b7f4daa
Summary: fontFamily, fontWeight and fontStyle properties are being ignored for TextInput. There's an additional issue that happens when you add secureTextEntry={true} it overrides the current font preferences (because it defaults to monospace) so we have to reapply it. Master right now: ![screen shot 2016-03-21 at 6 21 05 pm](https://cloud.githubusercontent.com/assets/1247834/13936110/c25ffea8-ef91-11e5-8d71-1b0a55184e24.png) Demo after the fix: ![5ux4bpjfwh](https://cloud.githubusercontent.com/assets/1247834/13935865/0f2ca8be-ef90-11e5-82c7-d5a2dd33b70e.gif) Closes facebook#6564 Differential Revision: D3081623 Pulled By: bestander fb-gh-sync-id: 329cac6755b5a0dd549e546768f39efa7b7f4daa fbshipit-source-id: 329cac6755b5a0dd549e546768f39efa7b7f4daa
Summary: fontFamily, fontWeight and fontStyle properties are being ignored for TextInput. There's an additional issue that happens when you add secureTextEntry={true} it overrides the current font preferences (because it defaults to monospace) so we have to reapply it. Master right now: ![screen shot 2016-03-21 at 6 21 05 pm](https://cloud.githubusercontent.com/assets/1247834/13936110/c25ffea8-ef91-11e5-8d71-1b0a55184e24.png) Demo after the fix: ![5ux4bpjfwh](https://cloud.githubusercontent.com/assets/1247834/13935865/0f2ca8be-ef90-11e5-82c7-d5a2dd33b70e.gif) Closes facebook#6564 Differential Revision: D3081623 Pulled By: bestander fb-gh-sync-id: 329cac6755b5a0dd549e546768f39efa7b7f4daa fbshipit-source-id: 329cac6755b5a0dd549e546768f39efa7b7f4daa
Summary: fontFamily, fontWeight and fontStyle properties are being ignored for TextInput. There's an additional issue that happens when you add secureTextEntry={true} it overrides the current font preferences (because it defaults to monospace) so we have to reapply it. Master right now: ![screen shot 2016-03-21 at 6 21 05 pm](https://cloud.githubusercontent.com/assets/1247834/13936110/c25ffea8-ef91-11e5-8d71-1b0a55184e24.png) Demo after the fix: ![5ux4bpjfwh](https://cloud.githubusercontent.com/assets/1247834/13935865/0f2ca8be-ef90-11e5-82c7-d5a2dd33b70e.gif) Closes facebook#6564 Differential Revision: D3081623 Pulled By: bestander fb-gh-sync-id: 329cac6755b5a0dd549e546768f39efa7b7f4daa fbshipit-source-id: 329cac6755b5a0dd549e546768f39efa7b7f4daa
Custom fontfamily is not supported for placeholder text |
I'm getting this in RN 0.63.3 |
i have RN updated an i have this same issue |
i'm getting this too |
when i set SecureTextEntry={true} , fontFamily show different fontFamily i change |
Also getting this in RN |
This solved for me (0.63.3): |
same issue 0.64.0 |
fontFamily, fontWeight and fontStyle properties are being ignored for TextInput.
There's an additional issue that happens when you add secureTextEntry={true} it overrides the current font preferences (because it defaults to monospace) so we have to reapply it.
Master right now:
Demo after the fix: