From a1a485f16e0f1720f2dcdf7ab03d52c29fe9e252 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Mon, 7 Jul 2025 13:46:01 +0200 Subject: Show custom fonts --- Map/Presentation/Theme/Font+theme.swift | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'Map/Presentation/Theme') diff --git a/Map/Presentation/Theme/Font+theme.swift b/Map/Presentation/Theme/Font+theme.swift index 079c0de..4660e48 100644 --- a/Map/Presentation/Theme/Font+theme.swift +++ b/Map/Presentation/Theme/Font+theme.swift @@ -48,27 +48,32 @@ extension Font { struct Map { static var note: Font { if UserDefaults.standard.bool(forKey: "useCustomFont"), - let customFontName = UserDefaults.standard.string(forKey: "customFontName"), - !customFontName.isEmpty { + let customFontName = UserDefaults.standard.string(forKey: "customFontName"), + !customFontName.isEmpty + { return Font.custom(customFontName, size: Dimensions.FontSize.Map.note).weight(.regular) } return Font.libertinus(size: Dimensions.FontSize.Map.note).weight(.regular) } - + static var axisLabel: Font { if UserDefaults.standard.bool(forKey: "useCustomFont"), - let customFontName = UserDefaults.standard.string(forKey: "customFontName"), - !customFontName.isEmpty { - return Font.custom(customFontName, size: Dimensions.FontSize.Map.axisLabel).weight(.regular) + let customFontName = UserDefaults.standard.string(forKey: "customFontName"), + !customFontName.isEmpty + { + return Font.custom(customFontName, size: Dimensions.FontSize.Map.axisLabel).weight( + .regular) } return Font.libertinus(size: Dimensions.FontSize.Map.axisLabel).weight(.regular) } - + static var vertexLabel: Font { if UserDefaults.standard.bool(forKey: "useCustomFont"), - let customFontName = UserDefaults.standard.string(forKey: "customFontName"), - !customFontName.isEmpty { - return Font.custom(customFontName, size: Dimensions.FontSize.Map.vertexLabel).weight(.regular) + let customFontName = UserDefaults.standard.string(forKey: "customFontName"), + !customFontName.isEmpty + { + return Font.custom(customFontName, size: Dimensions.FontSize.Map.vertexLabel).weight( + .regular) } return Font.libertinus(size: Dimensions.FontSize.Map.vertexLabel).weight(.regular) } -- cgit