refactored for custom fonts
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
0fffd38113
commit
21ab644c16
@ -8,13 +8,14 @@
|
||||
import Foundation
|
||||
|
||||
/// Enum that is matched up for the Verizon fonts.
|
||||
public enum Font: String, FontProtocol {
|
||||
public enum Font: FontProtocol {
|
||||
case edsBold
|
||||
case edsRegular
|
||||
case dsLight
|
||||
case etxBold
|
||||
case etxRegular
|
||||
|
||||
case custom(String)
|
||||
|
||||
public var fontName: String {
|
||||
switch self {
|
||||
case .edsBold:
|
||||
@ -27,9 +28,15 @@ public enum Font: String, FontProtocol {
|
||||
return "VerizonNHGeTX-Bold"
|
||||
case .etxRegular:
|
||||
return "VerizonNHGeTX-Regular"
|
||||
case .custom(let fontName):
|
||||
return fontName
|
||||
}
|
||||
}
|
||||
|
||||
public static var allCases: [Font] {
|
||||
[.edsBold, .edsRegular, .dsLight, .etxBold, .etxRegular]
|
||||
}
|
||||
|
||||
/// File Extension for each of the Font enums.
|
||||
public var fontFileExtension: String {
|
||||
return "otf"
|
||||
|
||||
@ -9,9 +9,10 @@ import Foundation
|
||||
import UIKit
|
||||
|
||||
/// Used in Classes that require Fonts
|
||||
public protocol FontProtocol: CaseIterable, RawRepresentable, Hashable {
|
||||
public protocol FontProtocol: Hashable {
|
||||
var fontFileExtension: String { get }
|
||||
var fontName: String { get }
|
||||
static var allCases: [Self] { get }
|
||||
}
|
||||
|
||||
extension FontProtocol {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user