Repository navigation
Commit 5cc89ee
Cache custom font family resolution on iOS Fabric
Resolving a custom `fontFamily` in `RCTFontWithFontProperties` enumerates the
family's faces and instantiates every one of them to pick the closest weight
and style, and it ran once per text fragment per attributed string build.
Cache the resolved font per family, size, weight and style, cleared when
fonts are registered at runtime, as the legacy `RCTFont.mm` already does for
its own lookups. Variants and variation settings are applied after the cache
as before.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>1 parent 96dddb0 commit 5cc89ee
1 file changed
Lines changed: 36 additions & 0 deletions
File tree
- packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
388 | 417 | | |
389 | 418 | | |
390 | 419 | | |
| |||
406 | 435 | | |
407 | 436 | | |
408 | 437 | | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
409 | 441 | | |
410 | 442 | | |
411 | 443 | | |
| |||
447 | 479 | | |
448 | 480 | | |
449 | 481 | | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
450 | 486 | | |
451 | 487 | | |
452 | 488 | | |
| |||
0 commit comments