-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Fabric] Implement maxFontSizeMultiplier in Text Input #14639
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
base: main
Are you sure you want to change the base?
[Fabric] Implement maxFontSizeMultiplier in Text Input #14639
Conversation
vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h
Outdated
Show resolved
Hide resolved
|
||
// Apply maxFontSizeMultiplier if specified | ||
auto maxFontSizeMultiplier = windowsTextInputProps().textAttributes.maxFontSizeMultiplier; | ||
fontSize *= |
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.
This presumably changes the size that the text actually renders with. Is this accounted for in the layout? -- Basically I think TextLayoutManager needs to also account for this property to correctly calculate the layout of this text.
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.
Oh i see. Thats part of the other PR.
Dont we need to get the font size from the layout? How do we get get the actual font size that the layout determined was appropriate?
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.
With Text we reuse the same TextLayout object that was modified by TextLayoutManager. For TextInput, I think we'd have to extract the size that was calculated from the TextLayout (or otherwise get it from the TextLayoutManager), so that we can set it on the CHARFORMAT?
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.
I referred to Android / IOS implementations. Let me get back on this tomorrow.
Description
Type of Change
Why
What is the motivation for this change? Add a few sentences describing the context and overall goals of the pull request's commits.
[Fabric] Implement maxFontSizeMultiplier in Text Input
Resolves #14638
What
What changes were made to the codebase to solve the bug, add the functionality, etc. that you specified above.
[Fabric] Implement maxFontSizeMultiplier in Text Input
https://reactnative.dev/docs/textinput#maxfontsizemultiplier
Please note waiting for this PR to be merged from upstream to uncomment commented code: facebook/react-native@97cf42f
Implemented as per IOS and Android.
Refer https://github.com/facebook/react-native/blob/e69e35e370a7751d258905e3348fd2b0bb2e93c1/packages/react-native/Libraries/Text/RCTTextAttributes.mm#L249
Screenshots
Add any relevant screen captures here from before or after your changes.
Testing
If you added tests that prove your changes are effective or that your feature works, add a few sentences here detailing the added test scenarios.
Tested in playground and manipulating node_modules file code in TextAttributes.h
Changelog
Should this change be included in the release notes: indicate yes or no Yes
Add a brief summary of the change to use in the release notes for the next release.
[Fabric] Implement maxFontSizeMultiplier in Text Input