FontWeight.swift 837 B

123456789101112131415161718192021222324252627282930
  1. import Foundation
  2. enum FontWeight: String, JSON, Identifiable, CaseIterable, Codable {
  3. var id: String { rawValue }
  4. case light
  5. case regular
  6. case medium
  7. case semibold
  8. case bold
  9. case black
  10. var displayName: String {
  11. switch self {
  12. case .light:
  13. return NSLocalizedString("LightFontWeight", comment: "")
  14. case .regular:
  15. return NSLocalizedString("RegularFontWeight", comment: "")
  16. case .medium:
  17. return NSLocalizedString("MediumFontWeight", comment: "")
  18. case .semibold:
  19. return NSLocalizedString("SemiboldFontWeight", comment: "")
  20. case .bold:
  21. return NSLocalizedString("BoldFontWeight", comment: "")
  22. case .black:
  23. return NSLocalizedString("BlackFontWeight", comment: "")
  24. }
  25. }
  26. }