1234567891011121314151617181920212223242526272829303132333435363738394041 |
- //
- // 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))
- }
-
- @objc static func UbuntuRegularFontWithSize(_ size: CGFloat) -> NSFont {
- return NSFont(name: "Ubuntu-Regular", size: max(1, size)) ?? NSFont.systemFont(ofSize: max(1, size))
- }
- }
|