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:
parent
ee202bea65
commit
59ff52ff9f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user