Skip to content

Commit b5d7200

Browse files
Update fonts and font sizes
- Use system fonts; remove custom fonts. - Standardize CardView font sizes
1 parent 091f860 commit b5d7200

12 files changed

+78
-105
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
**/xcuserdata
44
Carthage/
55
PRIVATE_KEYS.swift
6-
Fabled/Fonts
76
*.png

Fabled.xcodeproj/project.pbxproj

-16
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
0D0B60F022E679C5009D0FEF /* PlayerSearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D0B60EF22E679C5009D0FEF /* PlayerSearchViewController.swift */; };
2626
0D0B60F222E688AF009D0FEF /* exts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D0B60F122E688AF009D0FEF /* exts.swift */; };
2727
0D132340230368140000774D /* Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D13233F230368140000774D /* Style.swift */; };
28-
0D13234823037E2B0000774D /* NeueHaasGroteskRegular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0D13234623037E2B0000774D /* NeueHaasGroteskRegular.ttf */; };
29-
0D13234923037E2B0000774D /* NeueHaasGroteskMedium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0D13234723037E2B0000774D /* NeueHaasGroteskMedium.ttf */; };
3028
0D1DBFA622F8B59E0084F459 /* Model.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D1DBF9D22F8B59D0084F459 /* Model.framework */; };
3129
0D1DBFB222F8B59E0084F459 /* Model.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D1DBF9D22F8B59D0084F459 /* Model.framework */; };
3230
0D1DBFC122F8B78A0084F459 /* GloryRankTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D1DBFBB22F8B78A0084F459 /* GloryRankTests.swift */; };
@@ -138,8 +136,6 @@
138136
0D0D7EE222E79310009388CD /* PromiseKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PromiseKit.framework; path = Carthage/Build/iOS/PromiseKit.framework; sourceTree = "<group>"; };
139137
0D0D7EE322E79310009388CD /* PMKFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PMKFoundation.framework; path = Carthage/Build/iOS/PMKFoundation.framework; sourceTree = "<group>"; };
140138
0D13233F230368140000774D /* Style.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Style.swift; path = Sources/Style.swift; sourceTree = "<group>"; };
141-
0D13234623037E2B0000774D /* NeueHaasGroteskRegular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = NeueHaasGroteskRegular.ttf; sourceTree = "<group>"; };
142-
0D13234723037E2B0000774D /* NeueHaasGroteskMedium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = NeueHaasGroteskMedium.ttf; sourceTree = "<group>"; };
143139
0D1DBF9D22F8B59D0084F459 /* Model.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Model.framework; sourceTree = BUILT_PRODUCTS_DIR; };
144140
0D1DBFA022F8B59D0084F459 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
145141
0D1DBFA522F8B59D0084F459 /* ModelTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ModelTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -268,7 +264,6 @@
268264
0D0B60CC22E660B6009D0FEF /* Info.plist */,
269265
0D0B60C922E660B6009D0FEF /* LaunchScreen.storyboard */,
270266
0D70F8C422EA42F10025C83D /* PRIVATE_KEYS.swift */,
271-
0D13234123037C090000774D /* Fonts */,
272267
);
273268
name = "…";
274269
sourceTree = "<group>";
@@ -301,15 +296,6 @@
301296
path = State;
302297
sourceTree = SOURCE_ROOT;
303298
};
304-
0D13234123037C090000774D /* Fonts */ = {
305-
isa = PBXGroup;
306-
children = (
307-
0D13234723037E2B0000774D /* NeueHaasGroteskMedium.ttf */,
308-
0D13234623037E2B0000774D /* NeueHaasGroteskRegular.ttf */,
309-
);
310-
path = Fonts;
311-
sourceTree = "<group>";
312-
};
313299
0D1DBF9E22F8B59D0084F459 /* Model */ = {
314300
isa = PBXGroup;
315301
children = (
@@ -523,9 +509,7 @@
523509
buildActionMask = 2147483647;
524510
files = (
525511
0D0B60CB22E660B6009D0FEF /* LaunchScreen.storyboard in Resources */,
526-
0D13234823037E2B0000774D /* NeueHaasGroteskRegular.ttf in Resources */,
527512
0D0B60C822E660B6009D0FEF /* Assets.xcassets in Resources */,
528-
0D13234923037E2B0000774D /* NeueHaasGroteskMedium.ttf in Resources */,
529513
);
530514
runOnlyForDeploymentPostprocessing = 0;
531515
};

Fabled/Info.plist

-5
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@
3333
</dict>
3434
</dict>
3535
</dict>
36-
<key>UIAppFonts</key>
37-
<array>
38-
<string>NeueHaasGroteskMedium.ttf</string>
39-
<string>NeueHaasGroteskRegular.ttf</string>
40-
</array>
4136
<key>UILaunchStoryboardName</key>
4237
<string>LaunchScreen</string>
4338
<key>UIRequiredDeviceCapabilities</key>

Fabled/Sources/CardView.swift

+9
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,12 @@ class CardView: UIView {
3737
])
3838
}
3939
}
40+
41+
extension CardView {
42+
/// A collection of standard font related constants for `CardView`s.
43+
enum Font {
44+
static let titleSize: CGFloat = 60
45+
static let headingSize: CGFloat = 20
46+
static let bodySize: CGFloat = 15
47+
}
48+
}

Fabled/Sources/DebugUIViewController.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class DebugUIViewController: DeclarativeViewController {
3737
//MARK: Player Name, Glory & Rank
3838

3939
Text("starmunk")
40-
.font(Style.Font.NeueHaasGrotesk65Medium)
40+
.font(Style.Font.title)
4141
.fontSize(36)
4242
.adjustsFontSizeRelativeToDisplay(.x375)
4343
.color(.white),
@@ -55,7 +55,7 @@ final class DebugUIViewController: DeclarativeViewController {
5555
.color(.white)
5656
+
5757
Text(playerRankText)
58-
.fontSize(24)
58+
.fontSize(22)
5959
.adjustsFontSizeRelativeToDisplay(.x320)
6060
.color(.red),
6161

@@ -72,13 +72,13 @@ final class DebugUIViewController: DeclarativeViewController {
7272
Spacer(DisplayScale.x320.scale(12)),
7373

7474
Text(winsToFabled.binding)
75-
.font(Style.Font.NeueHaasGrotesk65Medium)
75+
.font(Style.Font.heading)
7676
.adjustsFontSizeRelativeToDisplay(.x320)
7777
.transforming(when: winsToFabledIsZero) { $0.textColor = .white }
7878
.transforming(when: winsToFabledIsZero, is: false) { $0.textColor = .red }
7979
+
8080
Text(moreWinsText)
81-
.font(Style.Font.NeueHaasGrotesk65Medium)
81+
.font(Style.Font.heading)
8282
.adjustsFontSizeRelativeToDisplay(.x320)
8383
.color(.white)
8484
+
@@ -144,7 +144,7 @@ final class DebugUIViewController: DeclarativeViewController {
144144
}
145145

146146
private func moreInfoButtonStyling(_ button: UIButton) {
147-
button.titleLabel?.font = UIFont(name: Style.Font.NeueHaasGrotesk65Medium, size: 14)
147+
button.titleLabel?.font = UIFont(name: Style.Font.title, size: 16)
148148
button.titleEdgeInsets.top = 1
149149
button.setTitleColor(.lightGray, for: .normal)
150150

Fabled/Sources/GloryProfileViewController.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class GloryProfileViewController: DeclarativeViewController, RootPresentationVie
4343
//MARK: Player Name, Glory & Rank
4444

4545
Text(playerName)
46-
.font(Style.Font.NeueHaasGrotesk65Medium)
46+
.font(Style.Font.title)
4747
.fontSize(36)
4848
.adjustsFontSizeRelativeToDisplay(.x375)
4949
.color(.white),
@@ -61,7 +61,7 @@ class GloryProfileViewController: DeclarativeViewController, RootPresentationVie
6161
.color(.white)
6262
+
6363
Text(playerRank)
64-
.fontSize(24)
64+
.fontSize(22)
6565
.adjustsFontSizeRelativeToDisplay(.x320)
6666
.color(.red),
6767

@@ -84,13 +84,13 @@ class GloryProfileViewController: DeclarativeViewController, RootPresentationVie
8484
Spacer(DisplayScale.x320.scale(12)),
8585

8686
Text(winsToFabled)
87-
.font(Style.Font.NeueHaasGrotesk65Medium)
87+
.font(Style.Font.heading)
8888
.adjustsFontSizeRelativeToDisplay(.x320)
8989
.transforming(when: winsToFabledIsZero) { $0.textColor = .white }
9090
.transforming(when: winsToFabledIsZero, is: false) { $0.textColor = .red }
9191
+
9292
Text(moreWinsText)
93-
.font(Style.Font.NeueHaasGrotesk65Medium)
93+
.font(Style.Font.heading)
9494
.adjustsFontSizeRelativeToDisplay(.x320)
9595
.color(.white)
9696
+
@@ -139,12 +139,12 @@ class GloryProfileViewController: DeclarativeViewController, RootPresentationVie
139139
override func viewDidLoad() {
140140
super.viewDidLoad()
141141
view.backgroundColor = Style.Color.background
142-
//FIXME: Build into `DeclarativeViewController`
142+
//TODO: Make `DeclarativeViewController` auto-broadcast its `State`
143143
playerProfile.broadcast()
144144
}
145145

146146
private func moreInfoButtonStyling(_ button: UIButton) {
147-
button.titleLabel?.font = UIFont(name: Style.Font.NeueHaasGrotesk65Medium, size: 14)
147+
button.titleLabel?.font = UIFont(name: Style.Font.title, size: 16)
148148
button.titleEdgeInsets.top = 1
149149
button.setTitleColor(.lightGray, for: .normal)
150150

Fabled/Sources/MoreInfoViewController.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ final class MoreInfoViewController: DeclarativeViewController {
1818
Scrollable(contentView:
1919
StackView(.vertical, [
2020
Text("FAQ")
21-
.font(Style.Font.NeueHaasGrotesk65Medium)
21+
.font(Style.Font.title)
2222
.alignment(.center)
2323
.fontSize(24)
2424
.color(.white),
@@ -66,7 +66,7 @@ final class MoreInfoViewController: DeclarativeViewController {
6666

6767
Text("——")
6868
.alignment(.center)
69-
.font(Style.Font.text)
69+
.font(Style.Font.body)
7070
.fontSize(22)
7171
.color(.white),
7272

@@ -220,7 +220,7 @@ final class MoreInfoViewController: DeclarativeViewController {
220220

221221
Button("Go Back")
222222
.observe(with: onGoBackPressed)
223-
.font(Style.Font.NeueHaasGrotesk65Medium)
223+
.font(Style.Font.heading)
224224
.fontSize(16)
225225
.titleColor(.white)
226226
.backgroundColor(.clear),
@@ -245,26 +245,26 @@ final class MoreInfoViewController: DeclarativeViewController {
245245
}
246246

247247
private func faqHeaderStyling(_ label: UILabel) {
248-
label.font = UIFont(name: Style.Font.text, size: 16)
248+
label.font = UIFont(name: Style.Font.heading, size: 16)
249249
label.textColor = .white
250250
}
251251

252252
private func faqBodyStyling(_ label: UILabel) {
253253
label.numberOfLines = 0
254-
label.font = UIFont(name: Style.Font.NeueHaasGrotesk65Medium, size: textSize)
254+
label.font = UIFont(name: Style.Font.body, size: textSize)
255255
label.textColor = .white
256256
}
257257

258258
private func categoryColumnStyling(_ label: UILabel) {
259-
label.font = UIFont(name: Style.Font.NeueHaasGrotesk65Medium, size: 16)
259+
label.font = UIFont(name: Style.Font.heading, size: 16)
260260
label.textColor = .white
261261
label.textAlignment = .right
262262
label.widthAnchor.constraint(equalToConstant: 72).isActive = true
263263
}
264264

265265
private func bodyColumnStyling(_ label: UILabel) {
266266
label.numberOfLines = 0
267-
label.font = UIFont(name: Style.Font.text, size: textSize)
267+
label.font = UIFont(name: Style.Font.body, size: textSize)
268268
label.textColor = .white
269269
}
270270

Fabled/Sources/NextRankupCard.swift

+8-10
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ final class NextRankupCard: CardView {
1414
Spacer(20),
1515

1616
Text(gloryToNextRankText)
17-
.font(Style.Font.NeueHaasGrotesk65Medium)
18-
.fontSize(60)
17+
.font(Style.Font.thicc)
18+
.fontSize(CardView.Font.titleSize)
1919
.adjustsFontSizeRelativeToDisplay(.x375)
2020
.color(.white)
2121
.contentHuggingPriority(.max),
@@ -24,7 +24,8 @@ final class NextRankupCard: CardView {
2424

2525
Text("Glory to next\nrank-up")
2626
.numberOfLines(2)
27-
.fontSize(20)
27+
.font(Style.Font.heading)
28+
.fontSize(CardView.Font.headingSize)
2829
.adjustsFontSizeRelativeToDisplay(.x375)
2930
.color(.white)
3031
.contentCompressionResistance(.max)
@@ -39,20 +40,17 @@ final class NextRankupCard: CardView {
3940
Spacer(4),
4041

4142
Text("That's ")
42-
.fontSize(17)
43-
.adjustsFontSizeRelativeToDisplay(.x375)
4443
.color(.white)
44+
.fontSize(CardView.Font.bodySize)
4545
+
4646
Text(winsToNextRankText)
47-
.font(Style.Font.NeueHaasGrotesk65Medium)
48-
.fontSize(20)
49-
.adjustsFontSizeRelativeToDisplay(.x375)
5047
.color(.red)
48+
.font(Style.Font.heading)
49+
.fontSize(CardView.Font.bodySize)
5150
+
5251
Text(moreWinsText)
53-
.fontSize(17)
54-
.adjustsFontSizeRelativeToDisplay(.x375)
5552
.color(.white),
53+
.fontSize(CardView.Font.bodySize)
5654

5755
Spacer(8)
5856
])

Fabled/Sources/PlayerSearchViewController.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ final class PlayerSearchViewController: DeclarativeViewController, RootPresentat
2222

2323
StackView(.vertical, [
2424
Text("Fabled")
25-
.font(Style.Font.NeueHaasGrotesk65Medium)
25+
.font(Style.Font.title)
2626
.fontSize(40)
2727
.color(.white),
2828

2929
Spacer(4),
3030

3131
Text("Destiny 2 Glory Tracker")
32-
.font(Style.Font.text)
3332
.color(.white),
33+
.font(Style.Font.body)
3434
])
3535
.alignment(.center)
3636
.offset(.vertical, -26), //Inset title text into image view
@@ -41,8 +41,8 @@ final class PlayerSearchViewController: DeclarativeViewController, RootPresentat
4141

4242
StackView(.vertical, [
4343
SegmentedControl(playerSearchPlatform.binding)
44-
.font(Style.Font.text)
4544
.titleColor(.white)
45+
.font(Style.Font.body)
4646
.titleColor(.black, while: .selected, .highlighted)
4747
.tintColor(.white)
4848
.backgroundColor(.clear),
@@ -58,8 +58,8 @@ final class PlayerSearchViewController: DeclarativeViewController, RootPresentat
5858
.autocorrectionType(.no)
5959
.autocapitalizationType(.none)
6060
.keyboardType(.twitter) //For BattleTag hash
61-
.font(Style.Font.text)
62-
.fontSize(16)
61+
.font(Style.Font.body)
62+
.fontSize(15)
6363
.placeholder("Select a platform to narrow your search")
6464
.transforming(when: playerSearchPlatform.binding, updatePlayerSearchFieldPlaceholder)
6565
.placeholderColor(.lightGray)
@@ -77,7 +77,7 @@ final class PlayerSearchViewController: DeclarativeViewController, RootPresentat
7777
Button("View Glory Profile")
7878
.observe(with: onViewPressed)
7979
.isEnabled(when: player.binding) { $0 != nil }
80-
.font(Style.Font.NeueHaasGrotesk65Medium)
80+
.font(Style.Font.heading)
8181
.fontSize(17)
8282
.titleColor(.white)
8383
.titleColor(.darkGray, while: .disabled),

Fabled/Sources/RecentActivityCard.swift

+14-18
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ final class RecentActivityCard: CardView {
1313
StackView(.horizontal, [
1414
Text("Current win\nstreak")
1515
.numberOfLines(2)
16-
.fontSize(20)
16+
.font(Style.Font.heading)
17+
.fontSize(CardView.Font.headingSize)
1718
.adjustsFontSizeRelativeToDisplay(.x375)
1819
.alignment(.right)
1920
.color(.white)
@@ -23,8 +24,8 @@ final class RecentActivityCard: CardView {
2324
Spacer(10),
2425

2526
Text(currentWinStreak)
26-
.font(Style.Font.NeueHaasGrotesk65Medium)
27-
.fontSize(60)
27+
.font(Style.Font.thicc)
28+
.fontSize(CardView.Font.titleSize)
2829
.adjustsFontSizeRelativeToDisplay(.x375)
2930
.color(.white)
3031
.contentHuggingPriority(.max)
@@ -38,38 +39,33 @@ final class RecentActivityCard: CardView {
3839
StackView(.horizontal, [
3940
Spacer(20),
4041

41-
Text("You've played ")
42-
.fontSize(17)
43-
.adjustsFontSizeRelativeToDisplay(.x375)
4442
.color(.white)
43+
Text("You've played ")
44+
.fontSize(CardView.Font.bodySize)
4545
+
4646
Text(matchesPlayedThisWeek)
47-
.font(Style.Font.NeueHaasGrotesk65Medium)
48-
.fontSize(20)
49-
.adjustsFontSizeRelativeToDisplay(.x375)
5047
.color(.white)
48+
.font(Style.Font.heading)
49+
.fontSize(CardView.Font.bodySize)
5150
+
52-
Text(" matches this week")
53-
.fontSize(17)
54-
.adjustsFontSizeRelativeToDisplay(.x375)
5551
.color(.white),
52+
Text(" matches this week")
53+
.fontSize(CardView.Font.bodySize)
5654

5755
Spacer(20)
5856
])
5957
.adjustsSpacingRelativeToDisplay(.x375),
6058

6159
Spacer(2),
6260

63-
Text("Winning ")
64-
.fontSize(17)
65-
.adjustsFontSizeRelativeToDisplay(.x375)
6661
.color(.white)
62+
Text("Winning ")
63+
.fontSize(CardView.Font.bodySize)
6764
+
6865
Text(matchesWonThisWeek)
69-
.font(Style.Font.NeueHaasGrotesk65Medium)
70-
.fontSize(20)
71-
.adjustsFontSizeRelativeToDisplay(.x375)
7266
.color(.white),
67+
.font(Style.Font.heading)
68+
.fontSize(CardView.Font.bodySize)
7369

7470
Spacer(8)
7571
])

0 commit comments

Comments
 (0)