add new font

This commit is contained in:
Xinlei(Ryan) Pan 2020-02-25 11:49:26 -05:00
parent 877cdd1dd4
commit 4ad4eb7f46
11 changed files with 49 additions and 25 deletions

View File

@ -126,6 +126,10 @@
94C2D9AB23872EB50006CF46 /* LabelAttributeActionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94C2D9AA23872EB50006CF46 /* LabelAttributeActionModel.swift */; }; 94C2D9AB23872EB50006CF46 /* LabelAttributeActionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94C2D9AA23872EB50006CF46 /* LabelAttributeActionModel.swift */; };
94C661D923CCF4B400D9FE5B /* LeftRightLabelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9402C34F23A2CEA3004B974C /* LeftRightLabelModel.swift */; }; 94C661D923CCF4B400D9FE5B /* LeftRightLabelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9402C34F23A2CEA3004B974C /* LeftRightLabelModel.swift */; };
94C661DA23CCF4FB00D9FE5B /* UIColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AA33B33239813C50067DD0F /* UIColor+Extension.swift */; }; 94C661DA23CCF4FB00D9FE5B /* UIColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AA33B33239813C50067DD0F /* UIColor+Extension.swift */; };
94CA227C24058534002D6750 /* VerizonNHGeTX-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 94CA227824058533002D6750 /* VerizonNHGeTX-Bold.otf */; };
94CA227D24058534002D6750 /* VerizonNHGeDS-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 94CA227924058533002D6750 /* VerizonNHGeDS-Regular.otf */; };
94CA227E24058534002D6750 /* VerizonNHGeDS-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 94CA227A24058533002D6750 /* VerizonNHGeDS-Bold.otf */; };
94CA227F24058534002D6750 /* VerizonNHGeTX-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 94CA227B24058533002D6750 /* VerizonNHGeTX-Regular.otf */; };
94F217B623E0BF6100A47C06 /* PrimaryButtonView.h in Headers */ = {isa = PBXBuildFile; fileRef = 94F217B423E0BF6100A47C06 /* PrimaryButtonView.h */; settings = {ATTRIBUTES = (Public, ); }; }; 94F217B623E0BF6100A47C06 /* PrimaryButtonView.h in Headers */ = {isa = PBXBuildFile; fileRef = 94F217B423E0BF6100A47C06 /* PrimaryButtonView.h */; settings = {ATTRIBUTES = (Public, ); }; };
94F217B723E0BF6100A47C06 /* PrimaryButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */; }; 94F217B723E0BF6100A47C06 /* PrimaryButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */; };
94FB966223D797DA003D482B /* MFTextButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 94FB966023D797DA003D482B /* MFTextButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; 94FB966223D797DA003D482B /* MFTextButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 94FB966023D797DA003D482B /* MFTextButton.h */; settings = {ATTRIBUTES = (Public, ); }; };
@ -288,10 +292,7 @@
D29DF2E121E9240B003B2FB9 /* MVMCoreUIPanelProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = D29DF2E021E9240B003B2FB9 /* MVMCoreUIPanelProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; D29DF2E121E9240B003B2FB9 /* MVMCoreUIPanelProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = D29DF2E021E9240B003B2FB9 /* MVMCoreUIPanelProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
D29DF2EE21ECEADF003B2FB9 /* MFFonts.h in Headers */ = {isa = PBXBuildFile; fileRef = D29DF14D21E693AD003B2FB9 /* MFFonts.h */; settings = {ATTRIBUTES = (Public, ); }; }; D29DF2EE21ECEADF003B2FB9 /* MFFonts.h in Headers */ = {isa = PBXBuildFile; fileRef = D29DF14D21E693AD003B2FB9 /* MFFonts.h */; settings = {ATTRIBUTES = (Public, ); }; };
D29DF2EF21ECEAE1003B2FB9 /* MFFonts.m in Sources */ = {isa = PBXBuildFile; fileRef = D29DF14C21E693AD003B2FB9 /* MFFonts.m */; }; D29DF2EF21ECEAE1003B2FB9 /* MFFonts.m in Sources */ = {isa = PBXBuildFile; fileRef = D29DF14C21E693AD003B2FB9 /* MFFonts.m */; };
D29DF31A21ECECC0003B2FB9 /* NHaasGroteskDSStd-45Lt.otf in Resources */ = {isa = PBXBuildFile; fileRef = D29DF31621ECECC0003B2FB9 /* NHaasGroteskDSStd-45Lt.otf */; };
D29DF31B21ECECC0003B2FB9 /* OCRAExtended.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D29DF31721ECECC0003B2FB9 /* OCRAExtended.ttf */; }; D29DF31B21ECECC0003B2FB9 /* OCRAExtended.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D29DF31721ECECC0003B2FB9 /* OCRAExtended.ttf */; };
D29DF31C21ECECC0003B2FB9 /* NHaasGroteskDSStd-75Bd.otf in Resources */ = {isa = PBXBuildFile; fileRef = D29DF31821ECECC0003B2FB9 /* NHaasGroteskDSStd-75Bd.otf */; };
D29DF31D21ECECC0003B2FB9 /* NHaasGroteskDSStd-55Rg.otf in Resources */ = {isa = PBXBuildFile; fileRef = D29DF31921ECECC0003B2FB9 /* NHaasGroteskDSStd-55Rg.otf */; };
D29DF32021ED0CBA003B2FB9 /* LabelView.h in Headers */ = {isa = PBXBuildFile; fileRef = D29DF31E21ED0CBA003B2FB9 /* LabelView.h */; settings = {ATTRIBUTES = (Public, ); }; }; D29DF32021ED0CBA003B2FB9 /* LabelView.h in Headers */ = {isa = PBXBuildFile; fileRef = D29DF31E21ED0CBA003B2FB9 /* LabelView.h */; settings = {ATTRIBUTES = (Public, ); }; };
D29DF32121ED0CBA003B2FB9 /* LabelView.m in Sources */ = {isa = PBXBuildFile; fileRef = D29DF31F21ED0CBA003B2FB9 /* LabelView.m */; }; D29DF32121ED0CBA003B2FB9 /* LabelView.m in Sources */ = {isa = PBXBuildFile; fileRef = D29DF31F21ED0CBA003B2FB9 /* LabelView.m */; };
D29DF32421ED0DA2003B2FB9 /* TextButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = D29DF32221ED0DA2003B2FB9 /* TextButtonView.m */; }; D29DF32421ED0DA2003B2FB9 /* TextButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = D29DF32221ED0DA2003B2FB9 /* TextButtonView.m */; };
@ -457,6 +458,10 @@
94C2D9A623872DA90006CF46 /* LabelAttributeColorModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelAttributeColorModel.swift; sourceTree = "<group>"; }; 94C2D9A623872DA90006CF46 /* LabelAttributeColorModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelAttributeColorModel.swift; sourceTree = "<group>"; };
94C2D9A823872E5E0006CF46 /* LabelAttributeImageModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelAttributeImageModel.swift; sourceTree = "<group>"; }; 94C2D9A823872E5E0006CF46 /* LabelAttributeImageModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelAttributeImageModel.swift; sourceTree = "<group>"; };
94C2D9AA23872EB50006CF46 /* LabelAttributeActionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelAttributeActionModel.swift; sourceTree = "<group>"; }; 94C2D9AA23872EB50006CF46 /* LabelAttributeActionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelAttributeActionModel.swift; sourceTree = "<group>"; };
94CA227824058533002D6750 /* VerizonNHGeTX-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "VerizonNHGeTX-Bold.otf"; sourceTree = "<group>"; };
94CA227924058533002D6750 /* VerizonNHGeDS-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "VerizonNHGeDS-Regular.otf"; sourceTree = "<group>"; };
94CA227A24058533002D6750 /* VerizonNHGeDS-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "VerizonNHGeDS-Bold.otf"; sourceTree = "<group>"; };
94CA227B24058533002D6750 /* VerizonNHGeTX-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "VerizonNHGeTX-Regular.otf"; sourceTree = "<group>"; };
94F217B423E0BF6100A47C06 /* PrimaryButtonView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrimaryButtonView.h; sourceTree = "<group>"; }; 94F217B423E0BF6100A47C06 /* PrimaryButtonView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrimaryButtonView.h; sourceTree = "<group>"; };
94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PrimaryButtonView.m; sourceTree = "<group>"; }; 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PrimaryButtonView.m; sourceTree = "<group>"; };
94FB966023D797DA003D482B /* MFTextButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFTextButton.h; sourceTree = "<group>"; }; 94FB966023D797DA003D482B /* MFTextButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFTextButton.h; sourceTree = "<group>"; };
@ -631,10 +636,7 @@
D29DF2CC21E7C104003B2FB9 /* MFLoadingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFLoadingViewController.h; sourceTree = "<group>"; }; D29DF2CC21E7C104003B2FB9 /* MFLoadingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFLoadingViewController.h; sourceTree = "<group>"; };
D29DF2CD21E7C104003B2FB9 /* MFLoadingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFLoadingViewController.m; sourceTree = "<group>"; }; D29DF2CD21E7C104003B2FB9 /* MFLoadingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFLoadingViewController.m; sourceTree = "<group>"; };
D29DF2E021E9240B003B2FB9 /* MVMCoreUIPanelProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreUIPanelProtocol.h; sourceTree = "<group>"; }; D29DF2E021E9240B003B2FB9 /* MVMCoreUIPanelProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreUIPanelProtocol.h; sourceTree = "<group>"; };
D29DF31621ECECC0003B2FB9 /* NHaasGroteskDSStd-45Lt.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "NHaasGroteskDSStd-45Lt.otf"; sourceTree = "<group>"; };
D29DF31721ECECC0003B2FB9 /* OCRAExtended.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = OCRAExtended.ttf; sourceTree = "<group>"; }; D29DF31721ECECC0003B2FB9 /* OCRAExtended.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = OCRAExtended.ttf; sourceTree = "<group>"; };
D29DF31821ECECC0003B2FB9 /* NHaasGroteskDSStd-75Bd.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "NHaasGroteskDSStd-75Bd.otf"; sourceTree = "<group>"; };
D29DF31921ECECC0003B2FB9 /* NHaasGroteskDSStd-55Rg.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "NHaasGroteskDSStd-55Rg.otf"; sourceTree = "<group>"; };
D29DF31E21ED0CBA003B2FB9 /* LabelView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelView.h; sourceTree = "<group>"; }; D29DF31E21ED0CBA003B2FB9 /* LabelView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelView.h; sourceTree = "<group>"; };
D29DF31F21ED0CBA003B2FB9 /* LabelView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LabelView.m; sourceTree = "<group>"; }; D29DF31F21ED0CBA003B2FB9 /* LabelView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LabelView.m; sourceTree = "<group>"; };
D29DF32221ED0DA2003B2FB9 /* TextButtonView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextButtonView.m; sourceTree = "<group>"; }; D29DF32221ED0DA2003B2FB9 /* TextButtonView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextButtonView.m; sourceTree = "<group>"; };
@ -1410,10 +1412,11 @@
D29DF31521ECECC0003B2FB9 /* Fonts */ = { D29DF31521ECECC0003B2FB9 /* Fonts */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
D29DF31621ECECC0003B2FB9 /* NHaasGroteskDSStd-45Lt.otf */, 94CA227A24058533002D6750 /* VerizonNHGeDS-Bold.otf */,
94CA227924058533002D6750 /* VerizonNHGeDS-Regular.otf */,
94CA227824058533002D6750 /* VerizonNHGeTX-Bold.otf */,
94CA227B24058533002D6750 /* VerizonNHGeTX-Regular.otf */,
D29DF31721ECECC0003B2FB9 /* OCRAExtended.ttf */, D29DF31721ECECC0003B2FB9 /* OCRAExtended.ttf */,
D29DF31821ECECC0003B2FB9 /* NHaasGroteskDSStd-75Bd.otf */,
D29DF31921ECECC0003B2FB9 /* NHaasGroteskDSStd-55Rg.otf */,
); );
path = Fonts; path = Fonts;
sourceTree = "<group>"; sourceTree = "<group>";
@ -1613,14 +1616,15 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
94CA227F24058534002D6750 /* VerizonNHGeTX-Regular.otf in Resources */,
D29DF2AF21E7B3A4003B2FB9 /* MFTextView.xib in Resources */, D29DF2AF21E7B3A4003B2FB9 /* MFTextView.xib in Resources */,
D29DF31C21ECECC0003B2FB9 /* NHaasGroteskDSStd-75Bd.otf in Resources */,
D29DF31D21ECECC0003B2FB9 /* NHaasGroteskDSStd-55Rg.otf in Resources */,
0A21DB8E235E06EF00C160A2 /* MFDigitTextField.xib in Resources */, 0A21DB8E235E06EF00C160A2 /* MFDigitTextField.xib in Resources */,
94CA227C24058534002D6750 /* VerizonNHGeTX-Bold.otf in Resources */,
D29DF32C21EE8736003B2FB9 /* Localizable.strings in Resources */, D29DF32C21EE8736003B2FB9 /* Localizable.strings in Resources */,
0A21DB86235E06EF00C160A2 /* MFTextField.xib in Resources */, 0A21DB86235E06EF00C160A2 /* MFTextField.xib in Resources */,
D29DF31A21ECECC0003B2FB9 /* NHaasGroteskDSStd-45Lt.otf in Resources */, 94CA227D24058534002D6750 /* VerizonNHGeDS-Regular.otf in Resources */,
D29DF32E21EE8C3D003B2FB9 /* Media.xcassets in Resources */, D29DF32E21EE8C3D003B2FB9 /* Media.xcassets in Resources */,
94CA227E24058534002D6750 /* VerizonNHGeDS-Bold.otf in Resources */,
D29DF31B21ECECC0003B2FB9 /* OCRAExtended.ttf in Resources */, D29DF31B21ECECC0003B2FB9 /* OCRAExtended.ttf in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;

View File

@ -20,9 +20,9 @@ import UIKit
navigationBar.shadowImage = UIImage() navigationBar.shadowImage = UIImage()
navigationBar.isOpaque = true navigationBar.isOpaque = true
navigationBar.tintColor = .black navigationBar.tintColor = .black
if let font = MFFonts.mfFont75Bd(MFSizeObject(standardSize: 14, standardiPadPortraitSize: 16, iPadProLandscapeSize: 18)?.getValueBasedOnScreenSize() ?? 14) { let font = MFFonts.mfFont75Bd(MFSizeObject(standardSize: 14, standardiPadPortraitSize: 16, iPadProLandscapeSize: 18)?.getValueBasedOnScreenSize() ?? 14)
navigationBar.titleTextAttributes = [NSAttributedString.Key.font: font];
} navigationBar.titleTextAttributes = [NSAttributedString.Key.font: font];
} }
public static func setupNavigationController() -> Self? { public static func setupNavigationController() -> Self? {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -12,9 +12,9 @@
@interface MFFonts : NSObject @interface MFFonts : NSObject
+ (nullable UIFont *)mfFont75Bd:(CGFloat)size; + (nonnull UIFont *)mfFont75Bd:(CGFloat)size;
+ (nullable UIFont *)mfFont55Rg:(CGFloat)size; + (nonnull UIFont *)mfFont55Rg:(CGFloat)size;
+ (nullable UIFont *)mfFontOcratxt:(CGFloat)size; + (nullable UIFont *)mfFontOcratxt:(CGFloat)size;
+ (nullable UIFont *)mfFontWithName:(nonnull NSString *)name size:(CGFloat)size; + (nonnull UIFont *)mfFontWithName:(nonnull NSString *)name size:(CGFloat)size;
@end @end

View File

@ -11,13 +11,21 @@
#import "MVMCoreUIUtility.h" #import "MVMCoreUIUtility.h"
@import MVMCore.MVMCoreLoggingHandler; @import MVMCore.MVMCoreLoggingHandler;
static NSString * const DSBold = @"VerizonNHGeDS-Bold";
static NSString * const DSRegular = @"VerizonNHGeDS-Regular";
static NSString * const TXBold = @"VerizonNHGeTX-Bold";
static NSString * const TXRegular = @"VerizonNHGeTX-Regular";
@implementation MFFonts @implementation MFFonts
+ (void)loadMVMFonts { + (void)loadMVMFonts {
static dispatch_once_t once; static dispatch_once_t once;
dispatch_once(&once, ^{ dispatch_once(&once, ^{
[MFFonts loadFont:@"NHaasGroteskDSStd-75Bd" type:@"otf"]; [MFFonts loadFont:DSBold type:@"otf"];
[MFFonts loadFont:@"NHaasGroteskDSStd-55Rg" type:@"otf"]; [MFFonts loadFont:DSRegular type:@"otf"];
[MFFonts loadFont:TXBold type:@"otf"];
[MFFonts loadFont:TXRegular type:@"otf"];
[MFFonts loadFont:@"OCRAExtended" type:@"ttf"]; [MFFonts loadFont:@"OCRAExtended" type:@"ttf"];
}); });
} }
@ -39,14 +47,26 @@
CFRelease(provider); CFRelease(provider);
} }
+ (nullable UIFont *)mfFont75Bd:(CGFloat)size { + (UIFont *)mfFont75Bd:(CGFloat)size {
[self loadMVMFonts]; [self loadMVMFonts];
return [UIFont fontWithName:@"NHaasGroteskDSStd-75Bd" size:size]; UIFont *font;
if (size >= 15) {
font = [UIFont fontWithName:DSBold size:size];
} else {
font = [UIFont fontWithName:TXBold size:size];
}
return font ?: [UIFont boldSystemFontOfSize:size];
} }
+ (nullable UIFont *)mfFont55Rg:(CGFloat)size { + (UIFont *)mfFont55Rg:(CGFloat)size {
[self loadMVMFonts]; [self loadMVMFonts];
return [UIFont fontWithName:@"NHaasGroteskDSStd-55Rg" size:size]; UIFont *font;
if (size >= 15) {
font = [UIFont fontWithName:DSRegular size:size];
} else {
font = [UIFont fontWithName:TXRegular size:size];
}
return font ?: [UIFont systemFontOfSize:size];
} }
+ (nullable UIFont *)mfFontOcratxt:(CGFloat)size { + (nullable UIFont *)mfFontOcratxt:(CGFloat)size {
@ -54,7 +74,7 @@
return [UIFont fontWithName:@"OCRAExtended" size:size]; return [UIFont fontWithName:@"OCRAExtended" size:size];
} }
+ (nullable UIFont *)mfFontWithName:(nonnull NSString *)name size:(CGFloat)size { + (UIFont *)mfFontWithName:(nonnull NSString *)name size:(CGFloat)size {
return [UIFont fontWithName:name size:size] ?: [self mfFont55Rg:size]; return [UIFont fontWithName:name size:size] ?: [self mfFont55Rg:size];
} }