12345678910111213141516171819202122232425262728293031323334353637 |
- //
- // NSFont+SFProText.swift
- // PDF Reader Pro
- //
- // Created by lizhe on 2023/2/8.
- //
- import Foundation
- extension NSFont {
- @objc static func SFProTextRegularFont(_ size: CGFloat) -> NSFont {
- return NSFont(name: "SFProText-Regular", size: max(1, size)) ?? NSFont.systemFont(ofSize: max(1, size))
- }
-
- @objc static func SFProTextSemiboldFont(_ size: CGFloat) -> NSFont {
- return NSFont(name: "SFProText-Semibold", size: max(1, size)) ?? NSFont.systemFont(ofSize: max(1, size))
- }
-
- @objc static func SFProTextBoldFont(_ size: CGFloat) -> NSFont {
- return NSFont(name: "SFProText-Bold", size: max(1, size)) ?? NSFont.systemFont(ofSize: max(1, size))
- }
-
- @objc static func SFProTextHeavyFont(_ size: CGFloat) -> NSFont {
- return NSFont(name: "SFProText-Heavy", size: max(1, size)) ?? NSFont.systemFont(ofSize: max(1, size))
- }
-
- @objc static func SFMediumFontWithSize(_ size: CGFloat) -> NSFont {
- return NSFont(name: "SFProText-Medium", size: max(1, size)) ?? NSFont.systemFont(ofSize: max(1, size))
- }
-
- @objc static func UbuntuMediumFontWithSize(_ size: CGFloat) -> NSFont {
- return NSFont(name: "Ubuntu-Medium", size: max(1, size)) ?? NSFont.systemFont(ofSize: max(1, size))
- }
-
- @objc static func UbuntuBoldFontWithSize(_ size: CGFloat) -> NSFont {
- return NSFont(name: "Ubuntu-Bold", size: max(1, size)) ?? NSFont.systemFont(ofSize: max(1, size))
- }
- }
|