added a buncha fonts

added a fonts enum
added a loadFonts, currently just prints all fonts available
This commit is contained in:
neon443 committed 2025-07-06 16:16:30 +01:00
1 parent 2b3610f827
commit 0d53ccc3bc
12 files changed
+109 -8

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
//
// Fonts.swift
// ShhShell
//
// Created by neon443 on 06/07/2025.
//
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
}
+14
View File
@@ -13,10 +13,13 @@ class HostsManager: ObservableObject, @unchecked Sendable {
private let userDefaults = NSUbiquitousKeyValueStore.default
@Published var hosts: [Host] = []
@Published var themes: [Theme] = []
@Published var selectedTheme: Theme = Theme.defaultTheme
@Published var selectedAnsi: Int = 1
@Published var fonts: [UIFont] = []
var tint: SwiftUI.Color {
selectedTheme.ansi[selectedAnsi].suiColor
}
@@ -24,6 +27,17 @@ class HostsManager: ObservableObject, @unchecked Sendable {
init() {
loadHosts()
loadThemes()
loadFonts()
}
func loadFonts() {
for family in UIFont.familyNames.sorted() {
let names = UIFont.fontNames(forFamilyName: family)
print("family: \(family), name: \(names)")
guard let customFont = UIFont(name: names[0], size: UIFont.systemFontSize) else {
fatalError()
}
}
}
func loadThemes() {
+16
View File
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIAppFonts</key>
<array>
<string>MesloLGS NF Regular.ttf</string>
<string>SF-Mono-Regular.otf</string>
<string>CascadiaMono.ttf</string>
<string>GeistMonoNerdFontMono-Regular.otf</string>
<string>JetBrainsMonoNerdFontMono-Regular.ttf</string>
<string>ComicMono.ttf</string>
<string>Comic Sans MS.ttf</string>
</array>
</dict>
</plist>
@@ -20,6 +20,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
self.hostsManager = hostsManager
applySelectedTheme()
//fonts here yayy
}
func restoreScrollback() {
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.