From 252beb311a35837f657111f8803f163cca7c7403 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 22 Oct 2019 11:40:50 -0400 Subject: [PATCH] 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 {