Skip to content

Conversation

@NickGerleman
Copy link
Contributor

Summary:
This information is lost by the time the AttributedString makes its way to be measured.

Pretty sure I've seen code do incorrect heuristics like grabbing first span for this (IIRC adjustFontSizeToFit does this)? Another case where we hit this on Android is when the last character is a newline (which is part of the Spannable), and layout needs to predict the size of the line which will come next (where it uses the EditText's underlying TextPaint, who is using these base attributes).

Changelog: [Internal]

Differential Revision: D63303709

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Sep 24, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63303709

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63303709

NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Sep 24, 2024
Summary:
Pull Request resolved: facebook#46612

This information is lost by the time the AttributedString makes its way to be measured.

Pretty sure I've seen code do incorrect heuristics like grabbing first span for this (IIRC adjustFontSizeToFit does this)? Another case where we hit this on Android is when the last character is a newline (which is part of the Spannable), and layout needs to predict the size of the line which will come next (where it uses the EditText's underlying TextPaint, who is using these base attributes).

Changelog: [Internal]

Differential Revision: D63303709
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63303709

NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Sep 30, 2024
Summary:
Pull Request resolved: facebook#46612

This information is lost by the time the AttributedString makes its way to be measured.

Pretty sure I've seen code do incorrect heuristics like grabbing first span for this (IIRC adjustFontSizeToFit does this)? Another case where we hit this on Android is when the last character is a newline (which is part of the Spannable), and layout needs to predict the size of the line which will come next (where it uses the EditText's underlying TextPaint, who is using these base attributes).

Changelog: [Internal]

Differential Revision: D63303709
Summary:

This information is lost by the time the AttributedString makes its way to be measured.

Pretty sure I've seen code do incorrect heuristics like grabbing first span for this (IIRC adjustFontSizeToFit does this)? Another case where we hit this on Android is when the last character is a newline (which is part of the Spannable), and layout needs to predict the size of the line which will come next (where it uses the EditText's underlying TextPaint, who is using these base attributes).

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D63303709
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63303709

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in a11a7c3.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Oct 3, 2024
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @NickGerleman in a11a7c3

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants