diff --git a/packages/react-native/Libraries/Text/Text/RCTDynamicTypeRamp.mm b/packages/react-native/Libraries/Text/Text/RCTDynamicTypeRamp.mm index c28eada58e6..a3fe8e1e2b3 100644 --- a/packages/react-native/Libraries/Text/Text/RCTDynamicTypeRamp.mm +++ b/packages/react-native/Libraries/Text/Text/RCTDynamicTypeRamp.mm @@ -34,7 +34,7 @@ UIFontMetrics *RCTUIFontMetricsForDynamicTypeRamp(RCTDynamicTypeRamp dynamicType static NSDictionary *mapping; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - mapping = @{ + NSMutableDictionary *mutableMapping = [@{ @(RCTDynamicTypeRampCaption2) : UIFontTextStyleCaption2, @(RCTDynamicTypeRampCaption1) : UIFontTextStyleCaption1, @(RCTDynamicTypeRampFootnote) : UIFontTextStyleFootnote, @@ -45,8 +45,11 @@ UIFontMetrics *RCTUIFontMetricsForDynamicTypeRamp(RCTDynamicTypeRamp dynamicType @(RCTDynamicTypeRampTitle3) : UIFontTextStyleTitle3, @(RCTDynamicTypeRampTitle2) : UIFontTextStyleTitle2, @(RCTDynamicTypeRampTitle1) : UIFontTextStyleTitle1, - @(RCTDynamicTypeRampLargeTitle) : UIFontTextStyleLargeTitle, - }; + } mutableCopy]; +#if !TARGET_OS_TV + mutableMapping[@(RCTDynamicTypeRampLargeTitle)] = UIFontTextStyleLargeTitle; +#endif + mapping = [mutableMapping copy]; }); id textStyle = diff --git a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm index 520a24c28f7..f96a0494000 100644 --- a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +++ b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm @@ -60,7 +60,12 @@ inline static UIFontTextStyle RCTUIFontTextStyleForDynamicTypeRamp(const Dynamic case DynamicTypeRamp::Title1: return UIFontTextStyleTitle1; case DynamicTypeRamp::LargeTitle: +// UIFontTextStyleLargeTitle is not available on tvOS. +#if !TARGET_OS_TV return UIFontTextStyleLargeTitle; +#else + return UIFontTextStyleTitle1; +#endif } }