FontTracking.swift 768 B

123456789101112131415161718192021222324252627282930313233
  1. import Foundation
  2. enum FontTracking: String, JSON, Identifiable, CaseIterable, Codable {
  3. var id: String { rawValue }
  4. case tighter
  5. case tight
  6. case normal
  7. case wide
  8. var displayName: String {
  9. switch self {
  10. case .tighter:
  11. NSLocalizedString("TighterFontTracking", comment: "")
  12. case .tight:
  13. NSLocalizedString("TightFontTracking", comment: "")
  14. case .normal:
  15. NSLocalizedString("NormalFontTracking", comment: "")
  16. case .wide:
  17. NSLocalizedString("WideFontTracking", comment: "")
  18. }
  19. }
  20. var value: Double {
  21. switch self {
  22. case .tighter: -0.07
  23. case .tight: -0.04
  24. case .normal: 0
  25. case .wide: 0.04
  26. }
  27. }
  28. }