diff --git a/Libraries/Text/RCTTextAttributes.m b/Libraries/Text/RCTTextAttributes.m index 8e8a26590a100d..b648d7192eb398 100644 --- a/Libraries/Text/RCTTextAttributes.m +++ b/Libraries/Text/RCTTextAttributes.m @@ -227,7 +227,7 @@ - (CGFloat)effectiveFontSizeMultiplier #if !TARGET_OS_OSX // [TODO(macOS GH#774) if (_dynamicTypeRamp != RCTDynamicTypeRampUndefined) { UIFontMetrics *fontMetrics = RCTUIFontMetricsForDynamicTypeRamp(_dynamicTypeRamp); - CGFloat baseSize = RCTUIBaseSizeForDynamicTypeRamp(_dynamicTypeRamp); + CGFloat baseSize = RCTBaseSizeForDynamicTypeRamp(_dynamicTypeRamp); fontSizeMultiplier = [fontMetrics scaledValueForValue:baseSize] / baseSize; } #endif // ]TODO(macOS GH#774) diff --git a/Libraries/Text/Text/RCTDynamicTypeRamp.h b/Libraries/Text/Text/RCTDynamicTypeRamp.h index 0a273158f65fbd..b79c189ee65785 100644 --- a/Libraries/Text/Text/RCTDynamicTypeRamp.h +++ b/Libraries/Text/Text/RCTDynamicTypeRamp.h @@ -16,7 +16,7 @@ typedef NS_ENUM(NSInteger, RCTDynamicTypeRamp) { RCTDynamicTypeRampCaption2, RCTDynamicTypeRampCaption1, RCTDynamicTypeRampFootnote, - RCTDynamicTypeRampSubhead, + RCTDynamicTypeRampSubheadline, RCTDynamicTypeRampCallout, RCTDynamicTypeRampBody, RCTDynamicTypeRampHeadline, @@ -36,5 +36,5 @@ typedef NS_ENUM(NSInteger, RCTDynamicTypeRamp) { /// Generates a `UIFontMetrics` instance representing a particular Dynamic Type ramp. UIFontMetrics * _Nonnull RCTUIFontMetricsForDynamicTypeRamp(RCTDynamicTypeRamp dynamicTypeRamp); /// The "reference" size for a particular font scale ramp, equal to a text element's size under default text size settings. -CGFloat RCTUIBaseSizeForDynamicTypeRamp(RCTDynamicTypeRamp dynamicTypeRamp); +CGFloat RCTBaseSizeForDynamicTypeRamp(RCTDynamicTypeRamp dynamicTypeRamp); #endif // ]TODO(macOS GH#774) diff --git a/Libraries/Text/Text/RCTDynamicTypeRamp.m b/Libraries/Text/Text/RCTDynamicTypeRamp.m index 803ac3c0316a59..bb584cd7d55771 100644 --- a/Libraries/Text/Text/RCTDynamicTypeRamp.m +++ b/Libraries/Text/Text/RCTDynamicTypeRamp.m @@ -15,7 +15,7 @@ @implementation RCTConvert (DynamicTypeRamp) @"caption2": @(RCTDynamicTypeRampCaption2), @"caption1": @(RCTDynamicTypeRampCaption1), @"footnote": @(RCTDynamicTypeRampFootnote), - @"subhead": @(RCTDynamicTypeRampSubhead), + @"subheadline": @(RCTDynamicTypeRampSubheadline), @"callout": @(RCTDynamicTypeRampCallout), @"body": @(RCTDynamicTypeRampBody), @"headline": @(RCTDynamicTypeRampHeadline), @@ -36,7 +36,7 @@ @implementation RCTConvert (DynamicTypeRamp) @(RCTDynamicTypeRampCaption2): UIFontTextStyleCaption2, @(RCTDynamicTypeRampCaption1): UIFontTextStyleCaption1, @(RCTDynamicTypeRampFootnote): UIFontTextStyleFootnote, - @(RCTDynamicTypeRampSubhead): UIFontTextStyleSubheadline, + @(RCTDynamicTypeRampSubheadline): UIFontTextStyleSubheadline, @(RCTDynamicTypeRampCallout): UIFontTextStyleCallout, @(RCTDynamicTypeRampBody): UIFontTextStyleBody, @(RCTDynamicTypeRampHeadline): UIFontTextStyleHeadline, @@ -51,7 +51,7 @@ @implementation RCTConvert (DynamicTypeRamp) return [UIFontMetrics metricsForTextStyle:textStyle]; } -CGFloat RCTUIBaseSizeForDynamicTypeRamp(RCTDynamicTypeRamp dynamicTypeRamp) { +CGFloat RCTBaseSizeForDynamicTypeRamp(RCTDynamicTypeRamp dynamicTypeRamp) { static NSDictionary *mapping; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -60,7 +60,7 @@ CGFloat RCTUIBaseSizeForDynamicTypeRamp(RCTDynamicTypeRamp dynamicTypeRamp) { @(RCTDynamicTypeRampCaption2): @11, @(RCTDynamicTypeRampCaption1): @12, @(RCTDynamicTypeRampFootnote): @13, - @(RCTDynamicTypeRampSubhead): @15, + @(RCTDynamicTypeRampSubheadline): @15, @(RCTDynamicTypeRampCallout): @16, @(RCTDynamicTypeRampBody): @17, @(RCTDynamicTypeRampHeadline): @17, diff --git a/Libraries/Text/TextProps.js b/Libraries/Text/TextProps.js index e705a2f85b2ee2..7b273f9f1f5c7c 100644 --- a/Libraries/Text/TextProps.js +++ b/Libraries/Text/TextProps.js @@ -193,7 +193,7 @@ export type TextProps = $ReadOnly<{| | 'caption2' | 'caption1' | 'footnote' - | 'subhead' + | 'subheadline' | 'callout' | 'body' | 'headline'