UIFont.swift 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // UIFont.swift
  3. // LoopKitUI
  4. //
  5. // Created by Nathaniel Hamming on 2020-01-17.
  6. // Copyright © 2020 LoopKit Authors. All rights reserved.
  7. //
  8. extension UIFont {
  9. public static var titleFontGroupedInset: UIFont {
  10. return UIFontMetrics(forTextStyle: .title1).scaledFont(for: systemFont(ofSize: 28, weight: .semibold))
  11. }
  12. public static var sectionHeaderFontGroupedInset: UIFont {
  13. return UIFontMetrics(forTextStyle: .headline).scaledFont(for: systemFont(ofSize: 19, weight: .semibold))
  14. }
  15. public static var footnote: UIFont {
  16. return preferredFont(forTextStyle: .footnote)
  17. }
  18. public static var instructionTitle: UIFont {
  19. return preferredFont(forTextStyle: .headline)
  20. }
  21. public static var instructionStep: UIFont {
  22. return UIFontMetrics(forTextStyle: .subheadline).scaledFont(for: systemFont(ofSize: 14))
  23. }
  24. public static var instructionNumber: UIFont {
  25. return preferredFont(forTextStyle: .subheadline)
  26. }
  27. public static var inputValue: UIFont {
  28. return UIFontMetrics(forTextStyle: .largeTitle).scaledFont(for: systemFont(ofSize: 48))
  29. }
  30. }