From 59ff52ff9f105bb6a8749145e9acf6aa27e60d44 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sat, 20 Jun 2020 09:54:44 +0200 Subject: [PATCH] Remove function to get regular monospace font names --- VimR/VimR/AppKitCommons.swift | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/VimR/VimR/AppKitCommons.swift b/VimR/VimR/AppKitCommons.swift index 40365c42..e7c969b3 100644 --- a/VimR/VimR/AppKitCommons.swift +++ b/VimR/VimR/AppKitCommons.swift @@ -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