-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#if canImport(AppKit) && !targetEnvironment(macCatalyst) | ||
import AppKit | ||
|
||
extension NSUIFontDescriptor.SymbolicTraits { | ||
public static let traitItalic = Self.italic | ||
public static let traitBold = Self.bold | ||
public static let traitExpanded = Self.expanded | ||
public static let traitCondensed = Self.condensed | ||
public static let traitMonoSpace = Self.monoSpace | ||
} | ||
|
||
#endif | ||
|
||
extension NSUIFontDescriptor { | ||
/// NSUI wrapper around `withSymbolicTraits`. | ||
/// | ||
/// This can return a nil value on iOS/visionOS. | ||
public func nsuiWithSymbolicTraits(_ symbolicTraits: NSUIFontDescriptor.SymbolicTraits) -> NSUIFontDescriptor? { | ||
Check warning on line 18 in Sources/NSUI/Font.swift GitHub Actions / Test (platform=macOS,variant=Mac Catalyst)
Check warning on line 18 in Sources/NSUI/Font.swift GitHub Actions / Test (platform=tvOS Simulator,name=Apple TV)
|
||
withSymbolicTraits(symbolicTraits) | ||
} | ||
} | ||
|
||
extension NSUIFont { | ||
/// NSUI wrapper around `init`. | ||
/// | ||
/// This initializer can fail on macOS. | ||
public convenience init?(nsuiDescriptor: NSUIFontDescriptor, size: CGFloat) { | ||
Check failure on line 27 in Sources/NSUI/Font.swift GitHub Actions / Test (platform=macOS,variant=Mac Catalyst)
Check warning on line 27 in Sources/NSUI/Font.swift GitHub Actions / Test (platform=macOS,variant=Mac Catalyst)
Check failure on line 27 in Sources/NSUI/Font.swift GitHub Actions / Test (platform=tvOS Simulator,name=Apple TV)
Check warning on line 27 in Sources/NSUI/Font.swift GitHub Actions / Test (platform=tvOS Simulator,name=Apple TV)
Check failure on line 27 in Sources/NSUI/Font.swift GitHub Actions / Test (platform=tvOS Simulator,name=Apple TV)
|
||
self.init(descriptor: nsuiDescriptor, size: size) | ||
} | ||
} |
This file was deleted.