From 25e0651eee8f20cc51f9fd2e5a888d0229db52e6 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Wed, 11 Mar 2020 12:07:20 -0400 Subject: [PATCH 1/5] images and links and stuff --- .../Atoms/Buttons/Link/ExternalLink.swift | 6 +++--- MVMCoreUI/Atoms/Views/Label/Label.swift | 19 +++++++------------ 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/MVMCoreUI/Atoms/Buttons/Link/ExternalLink.swift b/MVMCoreUI/Atoms/Buttons/Link/ExternalLink.swift index 3cd601b6..c311b435 100644 --- a/MVMCoreUI/Atoms/Buttons/Link/ExternalLink.swift +++ b/MVMCoreUI/Atoms/Buttons/Link/ExternalLink.swift @@ -47,11 +47,11 @@ open class ExternalLink: Link { trailingAnchor.constraint(greaterThanOrEqualTo: exportIcon.trailingAnchor).isActive = true if let titleLabel = titleLabel { - let dimension = round(0.6 * titleLabel.font.pointSize) + let dimension = titleLabel.font.pointSize exportIcon.heightAnchor.constraint(equalToConstant: dimension).isActive = true exportIcon.widthAnchor.constraint(equalToConstant: dimension).isActive = true - exportIcon.leadingAnchor.constraint(equalTo: titleLabel.trailingAnchor, constant: PaddingOne).isActive = true - exportIcon.bottomAnchor.constraint(equalTo: titleLabel.lastBaselineAnchor).isActive = true + exportIcon.leadingAnchor.constraint(equalTo: titleLabel.trailingAnchor, constant: 4).isActive = true + exportIcon.bottomAnchor.constraint(equalTo: titleLabel.lastBaselineAnchor, constant: 3).isActive = true } } } diff --git a/MVMCoreUI/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atoms/Views/Label/Label.swift index c7e72204..3a7d1f93 100644 --- a/MVMCoreUI/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atoms/Views/Label/Label.swift @@ -755,7 +755,7 @@ public typealias ActionBlock = () -> () */ static func getTextAttachmentImage(name: String = "externalLink", dimension: CGFloat) -> NSTextAttachment { - let dimension = round(dimension * 0.8) +// let dimension = round(dimension * 0.8) let imageAttachment = NSTextAttachment() imageAttachment.image = MVMCoreUIUtility.imageNamed(name) @@ -766,23 +766,18 @@ public typealias ActionBlock = () -> () static func getTextAttachmentFrom(url: String, dimension: CGFloat, label: Label) -> NSTextAttachment { - let dimension = round(dimension * 0.8) - let imageAttachment = NSTextAttachment() imageAttachment.bounds = CGRect(x: 0, y: 0, width: dimension, height: dimension) DispatchQueue.global(qos: .default).async { - - guard let url = URL(string: url), - let data = try? Data(contentsOf: url) - else { return } - - DispatchQueue.main.sync { - imageAttachment.image = UIImage(data: data) - label.setNeedsDisplay() + MVMCoreCache.shared()?.getImage(url, useWidth: false, widthForS7: 0, useHeight: false, heightForS7: 0, localFallbackImageName: nil) { image, data, _ in + + DispatchQueue.main.sync { + imageAttachment.image = image + label.setNeedsDisplay() + } } } - return imageAttachment } From c723d96cbf470870dc62e8978d01df411f082140 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 2 Apr 2020 08:48:24 -0400 Subject: [PATCH 2/5] removed comment --- MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index e74e57de..a630f63a 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -760,8 +760,6 @@ public typealias ActionBlock = () -> () */ static func getTextAttachmentImage(name: String = "externalLink", dimension: CGFloat) -> NSTextAttachment { -// let dimension = round(dimension * 0.8) - let imageAttachment = NSTextAttachment() imageAttachment.image = MVMCoreUIUtility.imageNamed(name) imageAttachment.bounds = CGRect(x: 0, y: 0, width: dimension, height: dimension) From 29805d347a7e38c1a265a3e1a8c1e51cdfd15418 Mon Sep 17 00:00:00 2001 From: "Xinlei(Ryan) Pan" Date: Fri, 3 Apr 2020 14:41:22 -0400 Subject: [PATCH 3/5] use new font for legacy --- MVMCoreUI/Utility/MFFonts.m | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Utility/MFFonts.m b/MVMCoreUI/Utility/MFFonts.m index 533b3a87..24c62a9a 100644 --- a/MVMCoreUI/Utility/MFFonts.m +++ b/MVMCoreUI/Utility/MFFonts.m @@ -85,14 +85,20 @@ NSString * const DS55Rg = @"NHaasGroteskDSStd-55Rg"; + (nonnull UIFont *)mfFont75Bd:(CGFloat)size { [self loadMVMFonts]; - UIFont *font = [UIFont fontWithName:DS75Bd size:size]; - return font ?: [UIFont boldSystemFontOfSize:size]; + if (size >= 15) { + return [MFFonts mfFontDSBold:size]; + } else { + return [MFFonts mfFontTXBold:size]; + } } + (nonnull UIFont *)mfFont55Rg:(CGFloat)size { [self loadMVMFonts]; - UIFont *font = [UIFont fontWithName:DS55Rg size:size]; - return font ?: [UIFont systemFontOfSize:size]; + if (size >= 15) { + return [MFFonts mfFontDSRegular:size]; + } else { + return [MFFonts mfFontTXRegular:size]; + } } + (nullable UIFont *)mfFontOcratxt:(CGFloat)size { From 3e38234d123a4282cdfda1ffeae3e4f4436559ac Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Wed, 8 Apr 2020 08:09:30 -0400 Subject: [PATCH 4/5] green --- MVMCoreUI/Categories/UIColor+MFConvenience.h | 1 + MVMCoreUI/Categories/UIColor+MFConvenience.m | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/MVMCoreUI/Categories/UIColor+MFConvenience.h b/MVMCoreUI/Categories/UIColor+MFConvenience.h index c3c78c7a..92b28a36 100644 --- a/MVMCoreUI/Categories/UIColor+MFConvenience.h +++ b/MVMCoreUI/Categories/UIColor+MFConvenience.h @@ -24,6 +24,7 @@ + (nonnull UIColor *)mvmOrange; + (nonnull UIColor *)mfPumpkinColor; + (nonnull UIColor *)mfShamrock; ++ (nonnull UIColor *)mvmGreen; + (nonnull UIColor *)mfCerulean; + (nonnull UIColor *)mfWhiteTwo; diff --git a/MVMCoreUI/Categories/UIColor+MFConvenience.m b/MVMCoreUI/Categories/UIColor+MFConvenience.m index 6ff8f70f..33df3848 100644 --- a/MVMCoreUI/Categories/UIColor+MFConvenience.m +++ b/MVMCoreUI/Categories/UIColor+MFConvenience.m @@ -61,6 +61,10 @@ return [UIColor mfColor8bitsWithRed:0 green:134 blue:49 alpha:1.0]; } ++ (nonnull UIColor *)mvmGreen { + return [UIColor mfColor8bitsWithRed:0 green:134 blue:48 alpha:1.0]; +} + + (nonnull UIColor *)mfCerulean { return [UIColor mfColor8bitsWithRed:0 green:122 blue:184 alpha:1.0]; } From c2e52ea31330c3c9c0921aa6440bf1773cd48731 Mon Sep 17 00:00:00 2001 From: "Pan, Xinlei (Ryan)" Date: Wed, 8 Apr 2020 11:51:14 -0400 Subject: [PATCH 5/5] Revert "Merge branch 'feature/usenewfont' into 'develop'" This reverts merge request !353 --- MVMCoreUI/Utility/MFFonts.m | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/MVMCoreUI/Utility/MFFonts.m b/MVMCoreUI/Utility/MFFonts.m index 24c62a9a..533b3a87 100644 --- a/MVMCoreUI/Utility/MFFonts.m +++ b/MVMCoreUI/Utility/MFFonts.m @@ -85,20 +85,14 @@ NSString * const DS55Rg = @"NHaasGroteskDSStd-55Rg"; + (nonnull UIFont *)mfFont75Bd:(CGFloat)size { [self loadMVMFonts]; - if (size >= 15) { - return [MFFonts mfFontDSBold:size]; - } else { - return [MFFonts mfFontTXBold:size]; - } + UIFont *font = [UIFont fontWithName:DS75Bd size:size]; + return font ?: [UIFont boldSystemFontOfSize:size]; } + (nonnull UIFont *)mfFont55Rg:(CGFloat)size { [self loadMVMFonts]; - if (size >= 15) { - return [MFFonts mfFontDSRegular:size]; - } else { - return [MFFonts mfFontTXRegular:size]; - } + UIFont *font = [UIFont fontWithName:DS55Rg size:size]; + return font ?: [UIFont systemFontOfSize:size]; } + (nullable UIFont *)mfFontOcratxt:(CGFloat)size {