Created
December 20, 2021 21:39
-
-
Save iSapozhnik/56260c43b2e56951b9cd12d712eb04cb to your computer and use it in GitHub Desktop.
Revisions
-
iSapozhnik created this gist
Dec 20, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ extension NSFont { class func roundedFont(ofSize size: CGFloat, weight: NSFont.Weight) -> NSFont { let systemFont = NSFont.systemFont(ofSize: size, weight: weight) guard let descriptor = systemFont.fontDescriptor.withDesign(.rounded), let roundedFont = NSFont(descriptor: descriptor, size: size) else { return systemFont } return roundedFont } }