From 69f8f7e81ca73ffbf1a0d76ccbd6cf8545caff57 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Mon, 7 Jul 2025 13:22:22 +0200 Subject: Add font customization --- Map/Presentation/Preferences/MapPreferencesView.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Map/Presentation/Preferences') diff --git a/Map/Presentation/Preferences/MapPreferencesView.swift b/Map/Presentation/Preferences/MapPreferencesView.swift index f8c976e..c5a9236 100644 --- a/Map/Presentation/Preferences/MapPreferencesView.swift +++ b/Map/Presentation/Preferences/MapPreferencesView.swift @@ -18,6 +18,8 @@ import SwiftUI struct MapPreferencesView: View { @AppStorage("showMapBackground") private var showBackground = true @AppStorage("useSmartEditor") private var useSmartEditor = false + @AppStorage("useCustomFont") private var useCustomFont = false + @AppStorage("customFontName") private var customFontName = "Helvetica" var body: some View { VStack(alignment: .center, spacing: Dimensions.Spacing.loose) { @@ -30,6 +32,18 @@ struct MapPreferencesView: View { Toggle(isOn: $showBackground, label: { Text("preferences.map.map_style.show_background") .font(.Theme.Body.regular) }) + + Toggle(isOn: $useCustomFont, label: { Text("preferences.map.map_style.use_custom_font") + .font(.Theme.Body.regular) + }) + + Picker("", selection: $customFontName) { + ForEach(NSFontManager.shared.availableFontFamilies, id: \.self) { fontFamily in + Text(fontFamily).tag(fontFamily) + } + } + .pickerStyle(MenuPickerStyle()) + .disabled(!useCustomFont) } .frame(maxWidth: .infinity, alignment: .leading) } -- cgit