Fix building for iOS
This commit is contained in:
parent
f38406e3ac
commit
cce4b56ee5
|
@ -65,7 +65,7 @@ extension NSAttributedString {
|
||||||
#if canImport(AppKit)
|
#if canImport(AppKit)
|
||||||
descriptor = descriptor.withSymbolicTraits(newSymbolicTraits)
|
descriptor = descriptor.withSymbolicTraits(newSymbolicTraits)
|
||||||
#else
|
#else
|
||||||
var descriptor = descriptor.withSymbolicTraits(newSymbolicTraits)!
|
descriptor = descriptor.withSymbolicTraits(newSymbolicTraits)!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if symbolicTraits.contains(boldTrait) {
|
if symbolicTraits.contains(boldTrait) {
|
||||||
|
@ -230,18 +230,22 @@ extension NSAttributedString {
|
||||||
var symbolicTraits = currentDescriptor.symbolicTraits
|
var symbolicTraits = currentDescriptor.symbolicTraits
|
||||||
|
|
||||||
if styles.contains(.bold) {
|
if styles.contains(.bold) {
|
||||||
symbolicTraits.insert(.bold)
|
symbolicTraits.insert(boldTrait)
|
||||||
}
|
}
|
||||||
|
|
||||||
if styles.contains(.italic) {
|
if styles.contains(.italic) {
|
||||||
symbolicTraits.insert(.italic)
|
symbolicTraits.insert(italicTrait)
|
||||||
}
|
}
|
||||||
|
|
||||||
if styles.contains(.monospace) {
|
if styles.contains(.monospace) {
|
||||||
symbolicTraits.insert(.monoSpace)
|
symbolicTraits.insert(monoSpaceTrait)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if canImport(AppKit)
|
||||||
descriptor = descriptor.withSymbolicTraits(symbolicTraits)
|
descriptor = descriptor.withSymbolicTraits(symbolicTraits)
|
||||||
|
#else
|
||||||
|
descriptor = descriptor.withSymbolicTraits(symbolicTraits)!
|
||||||
|
#endif
|
||||||
|
|
||||||
func verticalPositionFeature(forSuperscript: Bool) -> [FontDescriptor.FeatureKey: Any] {
|
func verticalPositionFeature(forSuperscript: Bool) -> [FontDescriptor.FeatureKey: Any] {
|
||||||
#if canImport(AppKit)
|
#if canImport(AppKit)
|
||||||
|
|
Loading…
Reference in New Issue