1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-25 23:02:35 +03:00

Remove function to get regular monospace font names

This commit is contained in:
Tae Won Ha 2020-06-20 09:54:44 +02:00
parent ee202bea65
commit 59ff52ff9f
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -253,29 +253,3 @@ extension NSScrollView {
return scrollView
}
}
extension NSFontManager {
func monospacedRegularFontNames() -> [String] {
self
.availableFontFamilies
.compactMap { name -> [(String, [Any])]? in
guard let members = self.availableMembers(ofFontFamily: name) else { return nil }
return members.map { member in (name, member) }
}
.flatMap { $0 }
.filter { element in
guard let trait = element.1[3] as? NSNumber,
let weight = element.1[2] as? NSNumber,
trait.uint32Value == NSFontDescriptor.SymbolicTraits.monoSpace.rawValue,
weight.intValue == regularWeight
else { return false }
return true
}
.map { $0.0 }
.uniqueing()
}
}
private let regularWeight = 5