Skip to content

Commit

Permalink
refactor: add IBMPlex fonts and misc refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrighetti committed Nov 4, 2023
1 parent 0007c9c commit 56bd25d
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 14 deletions.
24 changes: 24 additions & 0 deletions HNReader.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
330719203034BDB177F28C41 /* +DateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33071B0E5439D8D207CB68F4 /* +DateTests.swift */; };
33071F1C64D4742E1F947FAA /* ItemDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33071D0E5913DB91DDDBDADB /* ItemDownloader.swift */; };
5F109D592AF6F50D00AE6AF3 /* ConditionalRedactedModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F109D582AF6F50D00AE6AF3 /* ConditionalRedactedModifier.swift */; };
5F109D5F2AF704F700AE6AF3 /* IBMPlexSerif-Light.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5F109D5B2AF704F700AE6AF3 /* IBMPlexSerif-Light.ttf */; };
5F109D602AF704F700AE6AF3 /* IBMPlexSerif-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5F109D5C2AF704F700AE6AF3 /* IBMPlexSerif-Bold.ttf */; };
5F109D612AF704F700AE6AF3 /* IBMPlexSerif-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5F109D5D2AF704F700AE6AF3 /* IBMPlexSerif-Regular.ttf */; };
5F109D622AF704F700AE6AF3 /* IBMPlexSerif-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5F109D5E2AF704F700AE6AF3 /* IBMPlexSerif-SemiBold.ttf */; };
C93F99B6267554F00046F870 /* ItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C93F99B5267554F00046F870 /* ItemCell.swift */; };
C93F99B8267557FC0046F870 /* ItemList.swift in Sources */ = {isa = PBXBuildFile; fileRef = C93F99B7267557FC0046F870 /* ItemList.swift */; };
C93F99BA267580CE0046F870 /* HTMLText.swift in Sources */ = {isa = PBXBuildFile; fileRef = C93F99B9267580CE0046F870 /* HTMLText.swift */; };
Expand Down Expand Up @@ -51,6 +55,10 @@
33071E538EC434DF1A245518 /* HackerNewsClientTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HackerNewsClientTests.swift; sourceTree = "<group>"; };
33071EEBE46634E658582AE3 /* ItemTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ItemTests.swift; sourceTree = "<group>"; };
5F109D582AF6F50D00AE6AF3 /* ConditionalRedactedModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConditionalRedactedModifier.swift; sourceTree = "<group>"; };
5F109D5B2AF704F700AE6AF3 /* IBMPlexSerif-Light.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "IBMPlexSerif-Light.ttf"; sourceTree = "<group>"; };
5F109D5C2AF704F700AE6AF3 /* IBMPlexSerif-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "IBMPlexSerif-Bold.ttf"; sourceTree = "<group>"; };
5F109D5D2AF704F700AE6AF3 /* IBMPlexSerif-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "IBMPlexSerif-Regular.ttf"; sourceTree = "<group>"; };
5F109D5E2AF704F700AE6AF3 /* IBMPlexSerif-SemiBold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "IBMPlexSerif-SemiBold.ttf"; sourceTree = "<group>"; };
C93F99B5267554F00046F870 /* ItemCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemCell.swift; sourceTree = "<group>"; };
C93F99B7267557FC0046F870 /* ItemList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemList.swift; sourceTree = "<group>"; };
C93F99B9267580CE0046F870 /* HTMLText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTMLText.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -122,6 +130,17 @@
path = ModelTests;
sourceTree = "<group>";
};
5F96E4AB2AF70C2C00593AD6 /* fonts */ = {
isa = PBXGroup;
children = (
5F109D5C2AF704F700AE6AF3 /* IBMPlexSerif-Bold.ttf */,
5F109D5B2AF704F700AE6AF3 /* IBMPlexSerif-Light.ttf */,
5F109D5D2AF704F700AE6AF3 /* IBMPlexSerif-Regular.ttf */,
5F109D5E2AF704F700AE6AF3 /* IBMPlexSerif-SemiBold.ttf */,
);
path = fonts;
sourceTree = "<group>";
};
C9926691267588B80035A88F /* Components */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -151,6 +170,7 @@
C9D0937526741BBE002CC786 /* HNReader */ = {
isa = PBXGroup;
children = (
5F96E4AB2AF70C2C00593AD6 /* fonts */,
C9D093AA26741BFD002CC786 /* HNClient */,
C9D093A926741BF6002CC786 /* ViewModel */,
C9D093A826741BF0002CC786 /* Model */,
Expand Down Expand Up @@ -312,7 +332,11 @@
buildActionMask = 2147483647;
files = (
C9D0937E26741BBF002CC786 /* Preview Assets.xcassets in Resources */,
5F109D612AF704F700AE6AF3 /* IBMPlexSerif-Regular.ttf in Resources */,
5F109D602AF704F700AE6AF3 /* IBMPlexSerif-Bold.ttf in Resources */,
5F109D622AF704F700AE6AF3 /* IBMPlexSerif-SemiBold.ttf in Resources */,
C9D0937B26741BBF002CC786 /* Assets.xcassets in Resources */,
5F109D5F2AF704F700AE6AF3 /* IBMPlexSerif-Light.ttf in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>HNReader.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
7 changes: 7 additions & 0 deletions HNReader/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIAppFonts</key>
<array>
<string>IBMPlexSerif-Bold.ttf</string>
<string>IBMPlexSerif-SemiBold.ttf</string>
<string>IBMPlexSerif-Regular.ttf</string>
<string>IBMPlexSerif-Light.ttf</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
Expand Down
26 changes: 12 additions & 14 deletions HNReader/View/ItemCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,44 +23,41 @@ struct ItemCell: View {
HStack {
VStack(alignment: .leading, spacing: 5) {
Text(item?.title ?? String(repeating: "-", count: 30))
.font(.title2)
.fontWeight(.semibold)
.font(.custom("IBMPlexSerif-Bold", size: 17))
.redactIfNull(item)

Text(item?.urlHost ?? String(repeating: "-", count: 30))
.font(.callout)
.fontWeight(.light)
.foregroundColor(.white)
.font(.custom("IBMPlexSerif-Light", size: 12))
.redactIfNull(item)

HStack {
Text(item?.scoreString ?? String(repeating: "-", count: 3))
.font(.callout)
.fontWeight(.bold)
.font(.custom("IBMPlexSerif-SemiBold", size: 12))
.redactIfNull(item)

Text("Posted by \(item?.by ?? "?")")
.font(.callout)
.font(.custom("IBMPlexSerif-Regular", size: 12))
.redactIfNull(item)

Text("\(item?.timeStringRepresentation ?? String(repeating: "-", count: 3))")
.font(.callout)
.font(.custom("IBMPlexSerif-Regular", size: 12))
.redactIfNull(item)

Spacer()
}
}

HStack {

ZStack {
RoundedRectangle(cornerRadius: 15)
.foregroundStyle(Color.gray.opacity(0.1))
.frame(width: 50, height: 50)

Label(title: {}, icon: {
Image(systemName: "bubble.left")
})
.foregroundStyle(.primary)
.padding()
}
.frame(width: 50, height: 50)
Expand All @@ -79,15 +76,16 @@ struct ItemCell: View {
NSWorkspace.shared.open(url)
}
}

ZStack {
RoundedRectangle(cornerRadius: 15)
.foregroundStyle(Color.gray.opacity(0.1))
.frame(width: 50, height: 50)

Label(title: {}, icon: {
Image(systemName: "link")
Image(systemName: "arrow.up.right")
})
.foregroundStyle(.primary)
.padding()
}
.frame(width: 50, height: 50)
Expand Down
Binary file added HNReader/fonts/IBMPlexSerif-Bold.ttf
Binary file not shown.
Binary file added HNReader/fonts/IBMPlexSerif-Light.ttf
Binary file not shown.
Binary file added HNReader/fonts/IBMPlexSerif-Regular.ttf
Binary file not shown.
Binary file added HNReader/fonts/IBMPlexSerif-SemiBold.ttf
Binary file not shown.

0 comments on commit 56bd25d

Please sign in to comment.