From 7544a1ce243a8f7ab4fa7b183ee079b2d00e3310 Mon Sep 17 00:00:00 2001 From: Adam Gleitman Date: Mon, 17 Oct 2022 15:04:30 -0700 Subject: [PATCH 1/2] Dynamic type ramp: subhead -> subheadline --- Libraries/Text/Text/RCTDynamicTypeRamp.h | 2 +- Libraries/Text/Text/RCTDynamicTypeRamp.m | 6 +++--- Libraries/Text/TextProps.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Libraries/Text/Text/RCTDynamicTypeRamp.h b/Libraries/Text/Text/RCTDynamicTypeRamp.h index 0a273158f65fbd..b936329f0fa617 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, diff --git a/Libraries/Text/Text/RCTDynamicTypeRamp.m b/Libraries/Text/Text/RCTDynamicTypeRamp.m index 803ac3c0316a59..94f186e5823bb1 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, @@ -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' From 6a155f3f019851422b7f671dbe19358690a43270 Mon Sep 17 00:00:00 2001 From: Adam Gleitman Date: Mon, 17 Oct 2022 15:05:37 -0700 Subject: [PATCH 2/2] RCTUIBaseSizeForDynamicTypeRamp -> RCTBaseSizeForDynamicTypeRamp --- Libraries/Text/RCTTextAttributes.m | 2 +- Libraries/Text/Text/RCTDynamicTypeRamp.h | 2 +- Libraries/Text/Text/RCTDynamicTypeRamp.m | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 b936329f0fa617..b79c189ee65785 100644 --- a/Libraries/Text/Text/RCTDynamicTypeRamp.h +++ b/Libraries/Text/Text/RCTDynamicTypeRamp.h @@ -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 94f186e5823bb1..bb584cd7d55771 100644 --- a/Libraries/Text/Text/RCTDynamicTypeRamp.m +++ b/Libraries/Text/Text/RCTDynamicTypeRamp.m @@ -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, ^{