UIFont.swift 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. import UIKit
  9. extension UIFont {
  10. public static var titleFontGroupedInset: UIFont {
  11. return UIFontMetrics(forTextStyle: .title1).scaledFont(for: systemFont(ofSize: 28, weight: .semibold))
  12. }
  13. public static var sectionHeaderFontGroupedInset: UIFont {
  14. return UIFontMetrics(forTextStyle: .headline).scaledFont(for: systemFont(ofSize: 19, weight: .semibold))
  15. }
  16. public static var footnote: UIFont {
  17. return preferredFont(forTextStyle: .footnote)
  18. }
  19. public static var instructionTitle: UIFont {
  20. return preferredFont(forTextStyle: .headline)
  21. }
  22. public static var instructionStep: UIFont {
  23. return UIFontMetrics(forTextStyle: .subheadline).scaledFont(for: systemFont(ofSize: 14))
  24. }
  25. public static var instructionNumber: UIFont {
  26. return preferredFont(forTextStyle: .subheadline)
  27. }
  28. public static var inputValue: UIFont {
  29. return UIFontMetrics(forTextStyle: .largeTitle).scaledFont(for: systemFont(ofSize: 48))
  30. }
  31. }