- Add 10 new fonts (Literata, Merriweather, Source Serif, Lato, Montserrat, Source Sans) - Support Apple system fonts and Google Fonts (OFL 1.1 licensed) - Extend FontFamily enum with new fonts and categories - Update FontSettingsViewModel and WebView with font support - Force WebView reload when font settings change - Refactor OfflineSyncManager with protocol and improved error handling - Add test mocks and OfflineSyncManagerTests with 9 test cases - Add OpenSourceLicensesView and FontDebugView - Bump build number - Update localization strings
72 lines
1.9 KiB
Swift
72 lines
1.9 KiB
Swift
//
|
|
// FontDebugView.swift
|
|
// readeck
|
|
//
|
|
// Created by Ilyas Hallak on 05.12.25.
|
|
//
|
|
|
|
import SwiftUI
|
|
import UIKit
|
|
|
|
#if DEBUG
|
|
struct FontDebugView: View {
|
|
@State private var availableFonts: [String: [String]] = [:]
|
|
|
|
var body: some View {
|
|
NavigationStack {
|
|
List {
|
|
Section {
|
|
Text("This view shows all available font families and their font names. Use this to verify that custom fonts are loaded correctly.")
|
|
.font(.caption)
|
|
.foregroundColor(.secondary)
|
|
} header: {
|
|
Text("Debug Info")
|
|
}
|
|
|
|
ForEach(availableFonts.keys.sorted(), id: \.self) { family in
|
|
Section {
|
|
ForEach(availableFonts[family] ?? [], id: \.self) { fontName in
|
|
Text(fontName)
|
|
.font(.caption)
|
|
.textSelection(.enabled)
|
|
}
|
|
} header: {
|
|
Text(family)
|
|
.textSelection(.enabled)
|
|
}
|
|
}
|
|
}
|
|
.navigationTitle("Available Fonts")
|
|
.navigationBarTitleDisplayMode(.inline)
|
|
.toolbar {
|
|
ToolbarItem(placement: .confirmationAction) {
|
|
Button("Refresh") {
|
|
loadFonts()
|
|
}
|
|
}
|
|
}
|
|
.onAppear {
|
|
loadFonts()
|
|
}
|
|
}
|
|
}
|
|
|
|
private func loadFonts() {
|
|
var fonts: [String: [String]] = [:]
|
|
|
|
for family in UIFont.familyNames.sorted() {
|
|
let names = UIFont.fontNames(forFamilyName: family)
|
|
if !names.isEmpty {
|
|
fonts[family] = names
|
|
}
|
|
}
|
|
|
|
availableFonts = fonts
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
FontDebugView()
|
|
}
|
|
#endif
|