fixed letterspacing

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-06-19 16:20:16 -05:00
parent 1603beb911
commit 67cbef5265

View File

@ -48,6 +48,9 @@ public struct TextStyle: Equatable, RawRepresentable {
} }
} }
extension VDSTypography {
public static let letterSpacingSemiWide: CGFloat = 0.25
}
//MARK: Definitions //MARK: Definitions
extension TextStyle { extension TextStyle {
@ -56,169 +59,169 @@ extension TextStyle {
fontFace: .dsLight, fontFace: .dsLight,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature144 : VDSTypography.fontSizeFeature96, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature144 : VDSTypography.fontSizeFeature96,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature136 : VDSTypography.lineHeightFeature88, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature136 : VDSTypography.lineHeightFeature88,
letterSpacing: 0.25) letterSpacing: VDSTypography.letterSpacingSemiWide)
public static let boldFeatureXLarge = TextStyle(rawValue: "boldFeatureXLarge", public static let boldFeatureXLarge = TextStyle(rawValue: "boldFeatureXLarge",
fontFace: .dsBold, fontFace: .dsBold,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature144 : VDSTypography.fontSizeFeature96, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature144 : VDSTypography.fontSizeFeature96,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature136 : VDSTypography.lineHeightFeature88, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature136 : VDSTypography.lineHeightFeature88,
letterSpacing: 0.25) letterSpacing: 0)
public static let featureLarge = TextStyle(rawValue: "featureLarge", public static let featureLarge = TextStyle(rawValue: "featureLarge",
fontFace: .dsLight, fontFace: .dsLight,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature128 : VDSTypography.fontSizeFeature80, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature128 : VDSTypography.fontSizeFeature80,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature120 : VDSTypography.lineHeightFeature76, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature120 : VDSTypography.lineHeightFeature76,
letterSpacing: 0.25) letterSpacing: VDSTypography.letterSpacingSemiWide)
public static let boldFeatureLarge = TextStyle(rawValue: "boldFeatureLarge", public static let boldFeatureLarge = TextStyle(rawValue: "boldFeatureLarge",
fontFace: .dsBold, fontFace: .dsBold,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature128 : VDSTypography.fontSizeFeature80, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature128 : VDSTypography.fontSizeFeature80,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature120 : VDSTypography.lineHeightFeature76, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature120 : VDSTypography.lineHeightFeature76,
letterSpacing: 0.25) letterSpacing: 0)
public static let featureMedium = TextStyle(rawValue: "featureMedium", public static let featureMedium = TextStyle(rawValue: "featureMedium",
fontFace: .dsLight, fontFace: .dsLight,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature96 : VDSTypography.fontSizeFeature64, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature96 : VDSTypography.fontSizeFeature64,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature88 : VDSTypography.lineHeightFeature64, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature88 : VDSTypography.lineHeightFeature64,
letterSpacing: 0.25) letterSpacing: VDSTypography.letterSpacingSemiWide)
public static let boldFeatureMedium = TextStyle(rawValue: "boldFeatureMedium", public static let boldFeatureMedium = TextStyle(rawValue: "boldFeatureMedium",
fontFace: .dsBold, fontFace: .dsBold,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature96 : VDSTypography.fontSizeFeature64, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature96 : VDSTypography.fontSizeFeature64,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature88 : VDSTypography.lineHeightFeature64, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature88 : VDSTypography.lineHeightFeature64,
letterSpacing: 0.25) letterSpacing: 0)
public static let featureSmall = TextStyle(rawValue: "featureSmall", public static let featureSmall = TextStyle(rawValue: "featureSmall",
fontFace: .dsLight, fontFace: .dsLight,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature80 : VDSTypography.fontSizeFeature48, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature80 : VDSTypography.fontSizeFeature48,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature76 : VDSTypography.lineHeightFeature48, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature76 : VDSTypography.lineHeightFeature48,
letterSpacing: 0.25) letterSpacing: VDSTypography.letterSpacingSemiWide)
public static let boldFeatureSmall = TextStyle(rawValue: "boldFeatureSmall", public static let boldFeatureSmall = TextStyle(rawValue: "boldFeatureSmall",
fontFace: .dsBold, fontFace: .dsBold,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature80 : VDSTypography.fontSizeFeature48, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature80 : VDSTypography.fontSizeFeature48,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature76 : VDSTypography.lineHeightFeature48, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature76 : VDSTypography.lineHeightFeature48,
letterSpacing: 0.25) letterSpacing: 0)
public static let featureXSmall = TextStyle(rawValue: "featureXSmall", public static let featureXSmall = TextStyle(rawValue: "featureXSmall",
fontFace: .dsLight, fontFace: .dsLight,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature64 : VDSTypography.fontSizeFeature40, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature64 : VDSTypography.fontSizeFeature40,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature64 : VDSTypography.lineHeightFeature40, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature64 : VDSTypography.lineHeightFeature40,
letterSpacing: 0.25) letterSpacing: VDSTypography.letterSpacingSemiWide)
public static let boldFeatureXSmall = TextStyle(rawValue: "boldFeatureXSmall", public static let boldFeatureXSmall = TextStyle(rawValue: "boldFeatureXSmall",
fontFace: .dsBold, fontFace: .dsBold,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature64 : VDSTypography.fontSizeFeature40, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature64 : VDSTypography.fontSizeFeature40,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature64 : VDSTypography.lineHeightFeature40, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature64 : VDSTypography.lineHeightFeature40,
letterSpacing: 0.25) letterSpacing: 0)
public static let title2XLarge = TextStyle(rawValue: "title2XLarge", public static let title2XLarge = TextStyle(rawValue: "title2XLarge",
fontFace: .dsLight, fontFace: .dsLight,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle64 : VDSTypography.fontSizeTitle40, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle64 : VDSTypography.fontSizeTitle40,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle64 : VDSTypography.lineHeightTitle40, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle64 : VDSTypography.lineHeightTitle40,
letterSpacing: 0.25) letterSpacing: VDSTypography.letterSpacingSemiWide)
public static let boldTitle2XLarge = TextStyle(rawValue: "boldTitle2XLarge", public static let boldTitle2XLarge = TextStyle(rawValue: "boldTitle2XLarge",
fontFace: .dsBold, fontFace: .dsBold,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle64 : VDSTypography.fontSizeTitle40, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle64 : VDSTypography.fontSizeTitle40,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle64 : VDSTypography.lineHeightTitle40, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle64 : VDSTypography.lineHeightTitle40,
letterSpacing: 0.25) letterSpacing: 0)
public static let titleXLarge = TextStyle(rawValue: "titleXLarge", public static let titleXLarge = TextStyle(rawValue: "titleXLarge",
fontFace: .dsLight, fontFace: .dsLight,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle48 : VDSTypography.fontSizeTitle32, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle48 : VDSTypography.fontSizeTitle32,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle48 : VDSTypography.lineHeightTitle36, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle48 : VDSTypography.lineHeightTitle36,
letterSpacing: 0.25) letterSpacing: VDSTypography.letterSpacingSemiWide)
public static let boldTitleXLarge = TextStyle(rawValue: "boldTitleXLarge", public static let boldTitleXLarge = TextStyle(rawValue: "boldTitleXLarge",
fontFace: .dsBold, fontFace: .dsBold,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle48 : VDSTypography.fontSizeTitle32, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle48 : VDSTypography.fontSizeTitle32,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle48 : VDSTypography.lineHeightTitle36, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle48 : VDSTypography.lineHeightTitle36,
letterSpacing: 0.25) letterSpacing: 0)
public static let titleLarge = TextStyle(rawValue: "titleLarge", public static let titleLarge = TextStyle(rawValue: "titleLarge",
fontFace: .dsLight, fontFace: .dsLight,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle32 : VDSTypography.fontSizeTitle24, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle32 : VDSTypography.fontSizeTitle24,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle36 : VDSTypography.lineHeightTitle28, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle36 : VDSTypography.lineHeightTitle28,
letterSpacing: 0.25) letterSpacing: VDSTypography.letterSpacingSemiWide)
public static let boldTitleLarge = TextStyle(rawValue: "boldTitleLarge", public static let boldTitleLarge = TextStyle(rawValue: "boldTitleLarge",
fontFace: .dsBold, fontFace: .dsBold,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle32 : VDSTypography.fontSizeTitle24, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle32 : VDSTypography.fontSizeTitle24,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle36 : VDSTypography.lineHeightTitle28, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle36 : VDSTypography.lineHeightTitle28,
letterSpacing: 0.25) letterSpacing: 0)
public static let titleMedium = TextStyle(rawValue: "titleMedium", public static let titleMedium = TextStyle(rawValue: "titleMedium",
fontFace: .dsLight, fontFace: .dsLight,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle24 : VDSTypography.fontSizeTitle20, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle24 : VDSTypography.fontSizeTitle20,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle28 : VDSTypography.lineHeightTitle24, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle28 : VDSTypography.lineHeightTitle24,
letterSpacing: 0.25) letterSpacing: 0)
public static let boldTitleMedium = TextStyle(rawValue: "boldTitleMedium", public static let boldTitleMedium = TextStyle(rawValue: "boldTitleMedium",
fontFace: .dsBold, fontFace: .dsBold,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle24 : VDSTypography.fontSizeTitle20, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle24 : VDSTypography.fontSizeTitle20,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle28 : VDSTypography.lineHeightTitle24, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle28 : VDSTypography.lineHeightTitle24,
letterSpacing: 0.25) letterSpacing: 0)
public static let titleSmall = TextStyle(rawValue: "titleSmall", public static let titleSmall = TextStyle(rawValue: "titleSmall",
fontFace: .dsLight, fontFace: .dsLight,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle20 : VDSTypography.fontSizeTitle16, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle20 : VDSTypography.fontSizeTitle16,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle24 : VDSTypography.lineHeightTitle20, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle24 : VDSTypography.lineHeightTitle20,
letterSpacing: 0.25) letterSpacing: 0)
public static let boldTitleSmall = TextStyle(rawValue: "boldTitleSmall", public static let boldTitleSmall = TextStyle(rawValue: "boldTitleSmall",
fontFace: .dsBold, fontFace: .dsBold,
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle20 : VDSTypography.fontSizeTitle16, pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle20 : VDSTypography.fontSizeTitle16,
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle24 : VDSTypography.lineHeightTitle20, lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle24 : VDSTypography.lineHeightTitle20,
letterSpacing: 0.25) letterSpacing: 0)
public static let bodyLarge = TextStyle(rawValue: "bodyLarge", public static let bodyLarge = TextStyle(rawValue: "bodyLarge",
fontFace: .dsRegular, fontFace: .dsRegular,
pointSize: VDSTypography.fontSizeBody16, pointSize: VDSTypography.fontSizeBody16,
lineHeight: VDSTypography.lineHeightBody20, lineHeight: VDSTypography.lineHeightBody20,
letterSpacing: 0.5) letterSpacing:VDSTypography.letterSpacingWide)
public static let boldBodyLarge = TextStyle(rawValue: "boldBodyLarge", public static let boldBodyLarge = TextStyle(rawValue: "boldBodyLarge",
fontFace: .dsBold, fontFace: .dsBold,
pointSize: VDSTypography.fontSizeBody16, pointSize: VDSTypography.fontSizeBody16,
lineHeight: VDSTypography.lineHeightBody20, lineHeight: VDSTypography.lineHeightBody20,
letterSpacing: 0.5) letterSpacing: VDSTypography.letterSpacingWide)
public static let bodyMedium = TextStyle(rawValue: "bodyMedium", public static let bodyMedium = TextStyle(rawValue: "bodyMedium",
fontFace: .dsRegular, fontFace: .dsRegular,
pointSize: VDSTypography.fontSizeBody14, pointSize: VDSTypography.fontSizeBody14,
lineHeight: VDSTypography.lineHeightBody18, lineHeight: VDSTypography.lineHeightBody18,
letterSpacing: 0.5) letterSpacing: VDSTypography.letterSpacingWide)
public static let boldBodyMedium = TextStyle(rawValue: "boldBodyMedium", public static let boldBodyMedium = TextStyle(rawValue: "boldBodyMedium",
fontFace: .dsBold, fontFace: .dsBold,
pointSize: VDSTypography.fontSizeBody14, pointSize: VDSTypography.fontSizeBody14,
lineHeight: VDSTypography.lineHeightBody18, lineHeight: VDSTypography.lineHeightBody18,
letterSpacing: 0.5) letterSpacing: VDSTypography.letterSpacingWide)
public static let bodySmall = TextStyle(rawValue: "bodySmall", public static let bodySmall = TextStyle(rawValue: "bodySmall",
fontFace: .dsRegular, fontFace: .dsRegular,
pointSize: VDSTypography.fontSizeBody12, pointSize: VDSTypography.fontSizeBody12,
lineHeight: VDSTypography.lineHeightBody16, lineHeight: VDSTypography.lineHeightBody16,
letterSpacing: 0.25) letterSpacing: 0)
public static let boldBodySmall = TextStyle(rawValue: "boldBodySmall", public static let boldBodySmall = TextStyle(rawValue: "boldBodySmall",
fontFace: .dsBold, fontFace: .dsBold,
pointSize: VDSTypography.fontSizeBody12, pointSize: VDSTypography.fontSizeBody12,
lineHeight: VDSTypography.lineHeightBody16, lineHeight: VDSTypography.lineHeightBody16,
letterSpacing: 0.5) letterSpacing: 0)
public static let micro = TextStyle(rawValue: "micro", public static let micro = TextStyle(rawValue: "micro",
fontFace: .dsRegular, fontFace: .dsRegular,
pointSize: VDSTypography.fontSizeMicro11, pointSize: VDSTypography.fontSizeMicro11,
lineHeight: VDSTypography.lineHeightMicro16, lineHeight: VDSTypography.lineHeightMicro16,
letterSpacing: 0.25) letterSpacing: 0)
public static let boldMicro = TextStyle(rawValue: "boldMicro", public static let boldMicro = TextStyle(rawValue: "boldMicro",
fontFace: .dsBold, fontFace: .dsBold,
pointSize: VDSTypography.fontSizeMicro11, pointSize: VDSTypography.fontSizeMicro11,
lineHeight: VDSTypography.lineHeightMicro16, lineHeight: VDSTypography.lineHeightMicro16,
letterSpacing: 0.5) letterSpacing: 0)
public static var allCases: [TextStyle] { public static var allCases: [TextStyle] {
return [ return [