NSFont+SFProText.swift 689 B

123456789101112131415161718192021
  1. //
  2. // NSFont+SFProText.swift
  3. // PDF Master
  4. //
  5. // Created by lizhe on 2023/2/8.
  6. //
  7. import Foundation
  8. extension NSFont {
  9. @objc static func SFProTextRegular(_ size: CGFloat) -> NSFont {
  10. return NSFont(name: "SFProText-Regular", size: max(1, size)) ?? NSFont.systemFont(ofSize: max(1, size))
  11. }
  12. @objc static func SFProTextSemibold(_ size: CGFloat) -> NSFont {
  13. return NSFont(name: "SFProText-Semibold", size: max(1, size)) ?? NSFont.systemFont(ofSize: max(1, size))
  14. }
  15. @objc static func SFProTextBold(_ size: CGFloat) -> NSFont {
  16. return NSFont(name: "SFProText-Bold", size: max(1, size)) ?? NSFont.systemFont(ofSize: max(1, size))
  17. }
  18. }