mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
got loading some custom fonts, only ones with one "name" inside the family
This commit is contained in:
@@ -7,12 +7,16 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
enum FontFamilies: String, CaseIterable/*, CustomStringConvertible*/ {
|
||||
case mesloLGSNF = "MesloLGS NF"
|
||||
case sfMono = "SF Mono"
|
||||
case cascadiaMono
|
||||
case geistMonoNF
|
||||
case jetbrainsMonoNF
|
||||
case comicSans
|
||||
case comicMono
|
||||
enum Fonts: String, CaseIterable/*, CustomStringConvertible*/ {
|
||||
case mesloLGSNF = "MesloLGS-NF-Regular"
|
||||
case sfMono = "SFMono-Regular"
|
||||
case cascadiaMono = "CascadiaMono-Regular"
|
||||
case geistMonoNF = "GeistMonoNFM-Regular"
|
||||
case jetbrainsMonoNF = "JetBrainsMonoNFM-Regular"
|
||||
case comicSans = "ComicSansMS"
|
||||
case comicMono = "ComicMono"
|
||||
|
||||
static var fontNames: [String] {
|
||||
return Fonts.allCases.map { $0.rawValue }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,9 +31,12 @@ class HostsManager: ObservableObject, @unchecked Sendable {
|
||||
}
|
||||
|
||||
func loadFonts() {
|
||||
var customFonts: [UIFont] = []
|
||||
for family in UIFont.familyNames.sorted() {
|
||||
let names = UIFont.fontNames(forFamilyName: family)
|
||||
print("family: \(family), name: \(names)")
|
||||
if Fonts.fontNames.contains(names) {
|
||||
print(family)
|
||||
}
|
||||
guard let customFont = UIFont(name: names[0], size: UIFont.systemFontSize) else {
|
||||
fatalError()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user