Skip to content

Commit 2ec2404

Browse files
committed
updated login page title with proximanova font
- integrated proximanova fonts - integrated fonts with swiftgen
1 parent 53ba5f3 commit 2ec2404

File tree

10 files changed

+185
-4
lines changed

10 files changed

+185
-4
lines changed

GoInfoGame/GoInfoGame.xcodeproj/project.pbxproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@
159159
C75EAD372E042D4500F75969 /* SideWalkWidthForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973FC0132B4D353800878269 /* SideWalkWidthForm.swift */; };
160160
C76187DC2E0153D800150201 /* ClusterMap in Frameworks */ = {isa = PBXBuildFile; productRef = C76187DB2E0153D800150201 /* ClusterMap */; };
161161
C769AB552E431EFE00FA810A /* Strings+Generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = C769AB542E431EFE00FA810A /* Strings+Generated.swift */; };
162+
C76B63732E46019D0076A540 /* proximanova_bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = C76B636F2E46019D0076A540 /* proximanova_bold.otf */; };
163+
C76B63742E46019D0076A540 /* proximanova_regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = C76B63712E46019D0076A540 /* proximanova_regular.otf */; };
164+
C76B63752E46019D0076A540 /* proximanova_light.otf in Resources */ = {isa = PBXBuildFile; fileRef = C76B63702E46019D0076A540 /* proximanova_light.otf */; };
165+
C76B63762E46019D0076A540 /* proximanova_semibold.otf in Resources */ = {isa = PBXBuildFile; fileRef = C76B63722E46019D0076A540 /* proximanova_semibold.otf */; };
166+
C76B63792E4605570076A540 /* Fonts+Generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = C76B63772E4604000076A540 /* Fonts+Generated.swift */; };
162167
C76DA1A12DF0679F00451E63 /* LongFormModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA8C74C32C4FDE1000D28220 /* LongFormModel.swift */; };
163168
C77A4A262DF2AF3100DED8B0 /* SecureInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C77A4A252DF2AF3100DED8B0 /* SecureInputView.swift */; };
164169
C77AAC9D2E4463ED006713B2 /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = C77AAC9C2E4463ED006713B2 /* FirebaseAnalytics */; };
@@ -503,6 +508,11 @@
503508
C75CC5D82E0D22F4008A94A0 /* LongQuestsResponse.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = LongQuestsResponse.json; sourceTree = "<group>"; };
504509
C75E47732E151058006D903A /* Kondapur.gpx */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Kondapur.gpx; sourceTree = "<group>"; };
505510
C769AB542E431EFE00FA810A /* Strings+Generated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Strings+Generated.swift"; sourceTree = "<group>"; };
511+
C76B636F2E46019D0076A540 /* proximanova_bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = proximanova_bold.otf; sourceTree = "<group>"; };
512+
C76B63702E46019D0076A540 /* proximanova_light.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = proximanova_light.otf; sourceTree = "<group>"; };
513+
C76B63712E46019D0076A540 /* proximanova_regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = proximanova_regular.otf; sourceTree = "<group>"; };
514+
C76B63722E46019D0076A540 /* proximanova_semibold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = proximanova_semibold.otf; sourceTree = "<group>"; };
515+
C76B63772E4604000076A540 /* Fonts+Generated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Fonts+Generated.swift"; sourceTree = "<group>"; };
506516
C77A4A252DF2AF3100DED8B0 /* SecureInputView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureInputView.swift; sourceTree = "<group>"; };
507517
C77AAC992E446376006713B2 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
508518
C77AACA52E447364006713B2 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
@@ -1363,6 +1373,7 @@
13631373
C7927B542E42363000A7A34E /* Generated */ = {
13641374
isa = PBXGroup;
13651375
children = (
1376+
C76B63772E4604000076A540 /* Fonts+Generated.swift */,
13661377
C769AB542E431EFE00FA810A /* Strings+Generated.swift */,
13671378
C7927B532E42363000A7A34E /* XCAssets+Generated.swift */,
13681379
);
@@ -1446,6 +1457,10 @@
14461457
FA8C74D22C5998D600D28220 /* Lato-Medium.ttf */,
14471458
FA8C74D12C598F9D00D28220 /* Lato-Bold.ttf */,
14481459
FA8C74D02C598F9D00D28220 /* Lato-Regular.ttf */,
1460+
C76B636F2E46019D0076A540 /* proximanova_bold.otf */,
1461+
C76B63702E46019D0076A540 /* proximanova_light.otf */,
1462+
C76B63712E46019D0076A540 /* proximanova_regular.otf */,
1463+
C76B63722E46019D0076A540 /* proximanova_semibold.otf */,
14491464
);
14501465
path = Fonts;
14511466
sourceTree = "<group>";
@@ -1951,6 +1966,10 @@
19511966
files = (
19521967
973FC00A2B4D2A6D00878269 /* Localizable.strings in Resources */,
19531968
FAD5C4FF2AFCBE720040C61A /* LaunchScreen.storyboard in Resources */,
1969+
C76B63732E46019D0076A540 /* proximanova_bold.otf in Resources */,
1970+
C76B63742E46019D0076A540 /* proximanova_regular.otf in Resources */,
1971+
C76B63752E46019D0076A540 /* proximanova_light.otf in Resources */,
1972+
C76B63762E46019D0076A540 /* proximanova_semibold.otf in Resources */,
19541973
C71EB5BD2E2113500009E610 /* WMTSLayers.json in Resources */,
19551974
FAD5C4FC2AFCBE720040C61A /* Assets.xcassets in Resources */,
19561975
FAD5C4FA2AFCBE700040C61A /* Main.storyboard in Resources */,
@@ -2347,6 +2366,7 @@
23472366
971342792BBD691500174EBF /* MapViewControllerView.swift in Sources */,
23482367
C75EAD362E042D4500F75969 /* SideWalkWidth.swift in Sources */,
23492368
C75EAD372E042D4500F75969 /* SideWalkWidthForm.swift in Sources */,
2369+
C76B63792E4605570076A540 /* Fonts+Generated.swift in Sources */,
23502370
FA1992ED2BB1A78C003B4719 /* KeychainManager.swift in Sources */,
23512371
0536DD972B0BD95100B04C4B /* URLSession+Extension.swift in Sources */,
23522372
973FC04C2B5A5F5F00878269 /* RadioItem.swift in Sources */,
19.9 KB
Binary file not shown.
19.8 KB
Binary file not shown.
19.7 KB
Binary file not shown.
19.7 KB
Binary file not shown.
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
// swiftlint:disable all
2+
// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen
3+
4+
#if os(macOS)
5+
import AppKit.NSFont
6+
#elseif os(iOS) || os(tvOS) || os(watchOS)
7+
import UIKit.UIFont
8+
#endif
9+
#if canImport(SwiftUI)
10+
import SwiftUI
11+
#endif
12+
13+
// Deprecated typealiases
14+
@available(*, deprecated, renamed: "FontConvertible.Font", message: "This typealias will be removed in SwiftGen 7.0")
15+
internal typealias Font = FontConvertible.Font
16+
17+
// swiftlint:disable superfluous_disable_command file_length implicit_return
18+
19+
// MARK: - Fonts
20+
21+
// swiftlint:disable identifier_name line_length type_body_length
22+
internal enum FontFamily {
23+
internal enum FONTSPRINGDEMOProximaNova {
24+
internal static let bold = FontConvertible(name: "FONTSPRINGDEMO-ProximaNovaBold", family: "FONTSPRING DEMO - Proxima Nova", path: "proximanova_bold.otf")
25+
internal static let regular = FontConvertible(name: "FONTSPRINGDEMO-ProximaNovaRegular", family: "FONTSPRING DEMO - Proxima Nova", path: "proximanova_regular.otf")
26+
internal static let all: [FontConvertible] = [bold, regular]
27+
}
28+
internal enum FONTSPRINGDEMOProximaNovaLight {
29+
internal static let regular = FontConvertible(name: "FONTSPRINGDEMO-ProximaNovaLightRegular", family: "FONTSPRING DEMO - Proxima Nova Light", path: "proximanova_light.otf")
30+
internal static let all: [FontConvertible] = [regular]
31+
}
32+
internal enum FONTSPRINGDEMOProximaNovaSemibold {
33+
internal static let regular = FontConvertible(name: "FONTSPRINGDEMO-ProximaNovaSemiboldRegular", family: "FONTSPRING DEMO - Proxima Nova Semibold", path: "proximanova_semibold.otf")
34+
internal static let all: [FontConvertible] = [regular]
35+
}
36+
internal enum Lato {
37+
internal static let bold = FontConvertible(name: "Lato-Bold", family: "Lato", path: "Lato-Bold.ttf")
38+
internal static let medium = FontConvertible(name: "Lato-Medium", family: "Lato", path: "Lato-Medium.ttf")
39+
internal static let regular = FontConvertible(name: "Lato-Regular", family: "Lato", path: "Lato-Regular.ttf")
40+
internal static let all: [FontConvertible] = [bold, medium, regular]
41+
}
42+
internal static let allCustomFonts: [FontConvertible] = [FONTSPRINGDEMOProximaNova.all, FONTSPRINGDEMOProximaNovaLight.all, FONTSPRINGDEMOProximaNovaSemibold.all, Lato.all].flatMap { $0 }
43+
internal static func registerAllCustomFonts() {
44+
allCustomFonts.forEach { $0.register() }
45+
}
46+
}
47+
// swiftlint:enable identifier_name line_length type_body_length
48+
49+
// MARK: - Implementation Details
50+
51+
internal struct FontConvertible {
52+
internal let name: String
53+
internal let family: String
54+
internal let path: String
55+
56+
#if os(macOS)
57+
internal typealias Font = NSFont
58+
#elseif os(iOS) || os(tvOS) || os(watchOS)
59+
internal typealias Font = UIFont
60+
#endif
61+
62+
internal func font(size: CGFloat) -> Font {
63+
guard let font = Font(font: self, size: size) else {
64+
fatalError("Unable to initialize font '\(name)' (\(family))")
65+
}
66+
return font
67+
}
68+
69+
#if canImport(SwiftUI)
70+
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *)
71+
internal func swiftUIFont(size: CGFloat) -> SwiftUI.Font {
72+
return SwiftUI.Font.custom(self, size: size)
73+
}
74+
75+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, macOS 11.0, *)
76+
internal func swiftUIFont(fixedSize: CGFloat) -> SwiftUI.Font {
77+
return SwiftUI.Font.custom(self, fixedSize: fixedSize)
78+
}
79+
80+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, macOS 11.0, *)
81+
internal func swiftUIFont(size: CGFloat, relativeTo textStyle: SwiftUI.Font.TextStyle) -> SwiftUI.Font {
82+
return SwiftUI.Font.custom(self, size: size, relativeTo: textStyle)
83+
}
84+
#endif
85+
86+
internal func register() {
87+
// swiftlint:disable:next conditional_returns_on_newline
88+
guard let url = url else { return }
89+
CTFontManagerRegisterFontsForURL(url as CFURL, .process, nil)
90+
}
91+
92+
fileprivate func registerIfNeeded() {
93+
#if os(iOS) || os(tvOS) || os(watchOS)
94+
if !UIFont.fontNames(forFamilyName: family).contains(name) {
95+
register()
96+
}
97+
#elseif os(macOS)
98+
if let url = url, CTFontManagerGetScopeForURL(url as CFURL) == .none {
99+
register()
100+
}
101+
#endif
102+
}
103+
104+
fileprivate var url: URL? {
105+
// swiftlint:disable:next implicit_return
106+
return BundleToken.bundle.url(forResource: path, withExtension: nil)
107+
}
108+
}
109+
110+
internal extension FontConvertible.Font {
111+
convenience init?(font: FontConvertible, size: CGFloat) {
112+
font.registerIfNeeded()
113+
self.init(name: font.name, size: size)
114+
}
115+
}
116+
117+
#if canImport(SwiftUI)
118+
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *)
119+
internal extension SwiftUI.Font {
120+
static func custom(_ font: FontConvertible, size: CGFloat) -> SwiftUI.Font {
121+
font.registerIfNeeded()
122+
return custom(font.name, size: size)
123+
}
124+
}
125+
126+
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, macOS 11.0, *)
127+
internal extension SwiftUI.Font {
128+
static func custom(_ font: FontConvertible, fixedSize: CGFloat) -> SwiftUI.Font {
129+
font.registerIfNeeded()
130+
return custom(font.name, fixedSize: fixedSize)
131+
}
132+
133+
static func custom(
134+
_ font: FontConvertible,
135+
size: CGFloat,
136+
relativeTo textStyle: SwiftUI.Font.TextStyle
137+
) -> SwiftUI.Font {
138+
font.registerIfNeeded()
139+
return custom(font.name, size: size, relativeTo: textStyle)
140+
}
141+
}
142+
#endif
143+
144+
// swiftlint:disable convenience_type
145+
private final class BundleToken {
146+
static let bundle: Bundle = {
147+
#if SWIFT_PACKAGE
148+
return Bundle.module
149+
#else
150+
return Bundle(for: BundleToken.self)
151+
#endif
152+
}()
153+
}
154+
// swiftlint:enable convenience_type

GoInfoGame/GoInfoGame/Login/View/PosmLogin.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ struct PosmLoginView: View {
3535
Group {
3636
VStack(alignment: .leading) {
3737
Text("AVIV")
38-
.font(.custom("Lato-Bold", size: 50))
38+
.font(FontFamily.FONTSPRINGDEMOProximaNova.bold.swiftUIFont(size: 30))
3939
Text("ScoutRoute")
40-
.font(.custom("Lato-Bold", size: 20))
40+
.font(FontFamily.FONTSPRINGDEMOProximaNova.bold.swiftUIFont(size: 20))
4141
}
4242
}
4343
.foregroundColor(Asset.Colors.huskyPurple.swiftUIColor)

GoInfoGame/GoInfoGame/UI/CustomComponents/WidthView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct WidthView: View {
6868
isConfirmAlert = true
6969
} label: {
7070
Image(systemName: "checkmark.circle.fill")
71-
.font(Font.system(size: 40))
71+
.font(.custom("Lato-Bold", size: 40))
7272
.foregroundColor(.orange)
7373
}
7474
}

GoInfoGame/GoInfoGame/quests/LongQuests/Components/LongFormWidthView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct LongFormWidthView: View {
6464
isConfirmAlert = true
6565
} label: {
6666
Image(systemName: "checkmark.circle.fill")
67-
.font(Font.system(size: 40))
67+
.font(.custom("Lato-Bold", size: 40))
6868
.foregroundColor(.orange)
6969
}
7070
}

GoInfoGame/swiftgen.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,10 @@ strings:
6868
outputs:
6969
- templateName: structured-swift5
7070
output: GoInfoGame/Helpers/Generated/Strings+Generated.swift
71+
72+
fonts:
73+
inputs:
74+
- GoInfoGame/Fonts
75+
outputs:
76+
- templateName: swift5
77+
output: GoInfoGame/Helpers/Generated/Fonts+Generated.swift

0 commit comments

Comments
 (0)