Commit 9353eb5
- Fix fontVariant stylistic sets being ignored in New Architecture (#55183)
Summary:
During an upgrade of ReactNative and switching to new arch, we noticed that Android is ignoring *some* fontVariants. Specifically `stylistic-{num}`. Digging further I noticed that there are `stylistic-{num}` mappings added to `fromRawValue` (in `packages/react-native/ReactCommon/react/renderer/attributedstring/conversions.h`), but are not included for `toMapBuffer`
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[Android] [Fixed] - fontVariants `stylistic-{num}` not being propagated correctly
Pull Request resolved: #55183
Test Plan:
- Added a new free font (FiraCode) that has stylistic features.
- Added Text examples for Android showing with and without stylistic features
Before and after in order:
<img width="1080" height="2400" alt="Before" src="https://github.com/user-attachments/assets/3d21a992-f36a-4ffe-a1b2-8da40b3ee399" />
<img width="1080" height="2400" alt="After" src="https://github.com/user-attachments/assets/f4ee208a-3f98-42d9-b8c2-5b122d2db383" />
Reviewed By: cortinico
Differential Revision: D90830140
Pulled By: philIip
fbshipit-source-id: 42dbb98641274c0d4c01c501662b2ae59e21927d1 parent 97c9202 commit 9353eb5
5 files changed
Lines changed: 75 additions & 0 deletions
File tree
- packages
- react-native/ReactCommon/react/renderer/attributedstring
- rn-tester
- android/app/src/main
- java/com/facebook/react/uiapp
- res/font
- js/examples/Text
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1076 | 1076 | | |
1077 | 1077 | | |
1078 | 1078 | | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
1079 | 1139 | | |
1080 | 1140 | | |
1081 | 1141 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Binary file not shown.
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
392 | 402 | | |
393 | 403 | | |
394 | 404 | | |
| |||
0 commit comments