From 252beb311a35837f657111f8803f163cca7c7403 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 22 Oct 2019 11:40:50 -0400 Subject: [PATCH 1/3] dynamic type --- MVMCoreUI/Atoms/Views/Label.swift | 2 +- MVMCoreUI/Utility/MFFonts.m | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atoms/Views/Label.swift b/MVMCoreUI/Atoms/Views/Label.swift index 6fc496bd..d3195f45 100644 --- a/MVMCoreUI/Atoms/Views/Label.swift +++ b/MVMCoreUI/Atoms/Views/Label.swift @@ -80,7 +80,7 @@ public typealias ActionBlock = () -> () //------------------------------------------------------ @objc public func setupView() { - + adjustsFontForContentSizeCategory = true backgroundColor = .clear numberOfLines = 0 lineBreakMode = .byWordWrapping diff --git a/MVMCoreUI/Utility/MFFonts.m b/MVMCoreUI/Utility/MFFonts.m index 65326e6c..fad79299 100644 --- a/MVMCoreUI/Utility/MFFonts.m +++ b/MVMCoreUI/Utility/MFFonts.m @@ -41,12 +41,16 @@ + (nullable UIFont *)mfFont75Bd:(CGFloat)size { [self loadMVMFonts]; - return [UIFont fontWithName:@"NHaasGroteskDSStd-75Bd" size:size]; + UIFont *font = [UIFont fontWithName:@"NHaasGroteskDSStd-75Bd" size:size]; + UIFontMetrics *metrics = [UIFontMetrics metricsForTextStyle:UIFontTextStyleHeadline]; + return [metrics scaledFontForFont:font]; } + (nullable UIFont *)mfFont55Rg:(CGFloat)size { [self loadMVMFonts]; - return [UIFont fontWithName:@"NHaasGroteskDSStd-55Rg" size:size]; + UIFont *font = [UIFont fontWithName:@"NHaasGroteskDSStd-55Rg" size:size];; + UIFontMetrics *metrics = [UIFontMetrics metricsForTextStyle:UIFontTextStyleBody]; + return [metrics scaledFontForFont:font]; } + (nullable UIFont *)mfFontOcratxt:(CGFloat)size { From 0ff661f3c4941c0b277c99eab0e5294046a257bc Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 24 Oct 2019 09:31:01 -0400 Subject: [PATCH 2/3] revert for legacy --- MVMCoreUI/Atoms/Views/ViewConstrainingView.m | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Atoms/Views/ViewConstrainingView.m b/MVMCoreUI/Atoms/Views/ViewConstrainingView.m index c6b1023e..66a3a83d 100644 --- a/MVMCoreUI/Atoms/Views/ViewConstrainingView.m +++ b/MVMCoreUI/Atoms/Views/ViewConstrainingView.m @@ -314,10 +314,14 @@ [self.molecule updateView:size]; [MFStyler setMarginsForView:self size:size defaultHorizontal:self.updateViewHorizontalDefaults top:(self.updateViewVerticalDefaults ? self.topMarginPadding : 0) bottom:(self.updateViewVerticalDefaults ? self.bottomMarginPadding : 0)]; UIEdgeInsets margins = [MVMCoreUIUtility getMarginsForView:self]; - [self setLeftPinConstant:margins.left]; - [self setRightPinConstant:margins.right]; - [self setTopPinConstant:margins.top]; - [self setBottomPinConstant:margins.bottom]; + if (self.updateViewHorizontalDefaults) { + [self setLeftPinConstant:margins.left]; + [self setRightPinConstant:margins.right]; + } + if (self.updateViewVerticalDefaults) { + [self setTopPinConstant:margins.top]; + [self setBottomPinConstant:margins.bottom]; + } } #pragma mark - MVMCoreUIMoleculeViewProtocol From 603652537dd900baa040169dac39b176d6005a7c Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 24 Oct 2019 09:34:51 -0400 Subject: [PATCH 3/3] remove large text --- MVMCoreUI/Atoms/Views/Label.swift | 2 +- MVMCoreUI/Utility/MFFonts.m | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/MVMCoreUI/Atoms/Views/Label.swift b/MVMCoreUI/Atoms/Views/Label.swift index 5c825bb5..52ee43d1 100644 --- a/MVMCoreUI/Atoms/Views/Label.swift +++ b/MVMCoreUI/Atoms/Views/Label.swift @@ -80,7 +80,7 @@ public typealias ActionBlock = () -> () //------------------------------------------------------ @objc public func setupView() { - adjustsFontForContentSizeCategory = true + backgroundColor = .clear numberOfLines = 0 lineBreakMode = .byWordWrapping diff --git a/MVMCoreUI/Utility/MFFonts.m b/MVMCoreUI/Utility/MFFonts.m index fad79299..65326e6c 100644 --- a/MVMCoreUI/Utility/MFFonts.m +++ b/MVMCoreUI/Utility/MFFonts.m @@ -41,16 +41,12 @@ + (nullable UIFont *)mfFont75Bd:(CGFloat)size { [self loadMVMFonts]; - UIFont *font = [UIFont fontWithName:@"NHaasGroteskDSStd-75Bd" size:size]; - UIFontMetrics *metrics = [UIFontMetrics metricsForTextStyle:UIFontTextStyleHeadline]; - return [metrics scaledFontForFont:font]; + return [UIFont fontWithName:@"NHaasGroteskDSStd-75Bd" size:size]; } + (nullable UIFont *)mfFont55Rg:(CGFloat)size { [self loadMVMFonts]; - UIFont *font = [UIFont fontWithName:@"NHaasGroteskDSStd-55Rg" size:size];; - UIFontMetrics *metrics = [UIFontMetrics metricsForTextStyle:UIFontTextStyleBody]; - return [metrics scaledFontForFont:font]; + return [UIFont fontWithName:@"NHaasGroteskDSStd-55Rg" size:size]; } + (nullable UIFont *)mfFontOcratxt:(CGFloat)size {