Skip to content

Commit

Permalink
Merge pull request #145 from DeveloperAcademy-POSTECH/design/76-prete…
Browse files Browse the repository at this point in the history
…ndard-font-apply

[#76] Pretendard 폰트 적용
  • Loading branch information
dbqls200 authored Jan 3, 2025
2 parents 04562fc + c81f50d commit 83bd59c
Show file tree
Hide file tree
Showing 22 changed files with 320 additions and 62 deletions.
38 changes: 38 additions & 0 deletions TMT/TMT.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
5BF33BF42CE70E2E006F17EC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D86739702CA933CE00FFE8ED /* Assets.xcassets */; };
5BF33BF52CE70E37006F17EC /* Color.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81D9E9B2CE47F12004F2024 /* Color.swift */; };
D801A1BA2CF2213C00AD0D64 /* BusDataMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = D801A1B92CF2213C00AD0D64 /* BusDataMock.swift */; };
D80EFF0B2D26584200AC45C9 /* Pretendard-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = D80EFF072D26584200AC45C9 /* Pretendard-Bold.otf */; };
D80EFF0C2D26584200AC45C9 /* Pretendard-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = D80EFF092D26584200AC45C9 /* Pretendard-Regular.otf */; };
D80EFF0D2D26584200AC45C9 /* Pretendard-SemiBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = D80EFF0A2D26584200AC45C9 /* Pretendard-SemiBold.otf */; };
D80EFF0E2D26584200AC45C9 /* Pretendard-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = D80EFF082D26584200AC45C9 /* Pretendard-Medium.otf */; };
D80EFF0F2D26584200AC45C9 /* Pretendard-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = D80EFF072D26584200AC45C9 /* Pretendard-Bold.otf */; };
D80EFF102D26584200AC45C9 /* Pretendard-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = D80EFF092D26584200AC45C9 /* Pretendard-Regular.otf */; };
D80EFF112D26584200AC45C9 /* Pretendard-SemiBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = D80EFF0A2D26584200AC45C9 /* Pretendard-SemiBold.otf */; };
D80EFF122D26584200AC45C9 /* Pretendard-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = D80EFF082D26584200AC45C9 /* Pretendard-Medium.otf */; };
D81238912CF8C0560005EB25 /* TMTShareExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = D81238872CF8C0560005EB25 /* TMTShareExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
D81D9D3C2CE21CD1004F2024 /* JourneySettingModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81D9D3B2CE21CD1004F2024 /* JourneySettingModel.swift */; };
D81D9E9A2CE47F0D004F2024 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81D9E992CE47F0D004F2024 /* String.swift */; };
Expand Down Expand Up @@ -66,6 +74,8 @@
D8A1C0972CFA1B5C007D9F3F /* CaptureDark.json in Resources */ = {isa = PBXBuildFile; fileRef = D8A1C0932CFA1B5C007D9F3F /* CaptureDark.json */; };
D8A1C0982CFA1B5C007D9F3F /* IntroFinishDark.json in Resources */ = {isa = PBXBuildFile; fileRef = D8A1C0952CFA1B5C007D9F3F /* IntroFinishDark.json */; };
D8A1C0992CFA1B5C007D9F3F /* BusDotIntroDark.json in Resources */ = {isa = PBXBuildFile; fileRef = D8A1C0922CFA1B5C007D9F3F /* BusDotIntroDark.json */; };
D8BD64B72D265D7A00702C32 /* Font.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8BD64B62D265D7A00702C32 /* Font.swift */; };
D8BD64B82D265D7A00702C32 /* Font.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8BD64B62D265D7A00702C32 /* Font.swift */; };
D8C5E7322D006D31005FE865 /* LoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8C5E7312D006D31005FE865 /* LoadingView.swift */; };
D8C5E7362D006D53005FE865 /* LoadingCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8C5E7352D006D53005FE865 /* LoadingCase.swift */; };
D8D377E92CBE95C30043D103 /* BusSearchItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8D377E82CBE95C30043D103 /* BusSearchItem.swift */; };
Expand Down Expand Up @@ -137,6 +147,10 @@
5BE1BF5C2CF8C6100082648D /* ScannedJourneyInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScannedJourneyInfo.swift; sourceTree = "<group>"; };
5BE1BF5E2CF8C70C0082648D /* EndStopView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EndStopView.swift; sourceTree = "<group>"; };
D801A1B92CF2213C00AD0D64 /* BusDataMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BusDataMock.swift; sourceTree = "<group>"; };
D80EFF072D26584200AC45C9 /* Pretendard-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Bold.otf"; sourceTree = "<group>"; };
D80EFF082D26584200AC45C9 /* Pretendard-Medium.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Medium.otf"; sourceTree = "<group>"; };
D80EFF092D26584200AC45C9 /* Pretendard-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Regular.otf"; sourceTree = "<group>"; };
D80EFF0A2D26584200AC45C9 /* Pretendard-SemiBold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-SemiBold.otf"; sourceTree = "<group>"; };
D81238872CF8C0560005EB25 /* TMTShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = TMTShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
D81238962CF8C07C0005EB25 /* TMTRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = TMTRelease.entitlements; sourceTree = "<group>"; };
D81238982CF8C3380005EB25 /* TMT.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = TMT.entitlements; sourceTree = "<group>"; };
Expand Down Expand Up @@ -169,6 +183,7 @@
D8A1C0932CFA1B5C007D9F3F /* CaptureDark.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = CaptureDark.json; sourceTree = "<group>"; };
D8A1C0942CFA1B5C007D9F3F /* GoNaverMapDark.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = GoNaverMapDark.json; sourceTree = "<group>"; };
D8A1C0952CFA1B5C007D9F3F /* IntroFinishDark.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = IntroFinishDark.json; sourceTree = "<group>"; };
D8BD64B62D265D7A00702C32 /* Font.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Font.swift; sourceTree = "<group>"; };
D8C5E7312D006D31005FE865 /* LoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingView.swift; sourceTree = "<group>"; };
D8C5E7352D006D53005FE865 /* LoadingCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingCase.swift; sourceTree = "<group>"; };
D8D377E82CBE95C30043D103 /* BusSearchItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BusSearchItem.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -276,6 +291,17 @@
path = BottomSheet;
sourceTree = "<group>";
};
D80EFF062D26580200AC45C9 /* Font */ = {
isa = PBXGroup;
children = (
D80EFF072D26584200AC45C9 /* Pretendard-Bold.otf */,
D80EFF082D26584200AC45C9 /* Pretendard-Medium.otf */,
D80EFF092D26584200AC45C9 /* Pretendard-Regular.otf */,
D80EFF0A2D26584200AC45C9 /* Pretendard-SemiBold.otf */,
);
path = Font;
sourceTree = "<group>";
};
D81D9E912CE47D84004F2024 /* Models */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -357,6 +383,7 @@
D81D9E9B2CE47F12004F2024 /* Color.swift */,
D8E054DC2CF1AF89006B1879 /* View.swift */,
D82CB2322CFE103800A93217 /* UIApplication.swift */,
D8BD64B62D265D7A00702C32 /* Font.swift */,
);
path = Extension;
sourceTree = "<group>";
Expand Down Expand Up @@ -529,6 +556,7 @@
D8D377E42CBE548F0043D103 /* Resource */ = {
isa = PBXGroup;
children = (
D80EFF062D26580200AC45C9 /* Font */,
5B60774A2CFE1A2D0075A026 /* InfoPlist.strings */,
D86A9ED52CEC681C00B252F8 /* BusStop */,
D86A9ED62CEC682900B252F8 /* Onboarding */,
Expand Down Expand Up @@ -669,6 +697,10 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D80EFF0B2D26584200AC45C9 /* Pretendard-Bold.otf in Resources */,
D80EFF0C2D26584200AC45C9 /* Pretendard-Regular.otf in Resources */,
D80EFF0D2D26584200AC45C9 /* Pretendard-SemiBold.otf in Resources */,
D80EFF0E2D26584200AC45C9 /* Pretendard-Medium.otf in Resources */,
5BF33BF42CE70E2E006F17EC /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -685,6 +717,10 @@
D8A1C0962CFA1B5C007D9F3F /* GoNaverMapDark.json in Resources */,
5BD057AA2CFEA376003D9F5A /* BusStopData.csv in Resources */,
D8A1C0972CFA1B5C007D9F3F /* CaptureDark.json in Resources */,
D80EFF0F2D26584200AC45C9 /* Pretendard-Bold.otf in Resources */,
D80EFF102D26584200AC45C9 /* Pretendard-Regular.otf in Resources */,
D80EFF112D26584200AC45C9 /* Pretendard-SemiBold.otf in Resources */,
D80EFF122D26584200AC45C9 /* Pretendard-Medium.otf in Resources */,
D8A1C0982CFA1B5C007D9F3F /* IntroFinishDark.json in Resources */,
D8A1C0992CFA1B5C007D9F3F /* BusDotIntroDark.json in Resources */,
D86A9EE62CEC696700B252F8 /* IntroFinish.json in Resources */,
Expand All @@ -709,6 +745,7 @@
files = (
D82CB2332CFE103800A93217 /* UIApplication.swift in Sources */,
D8E7E7122CF60FD300EAD54F /* StopStatusEnum.swift in Sources */,
D8BD64B82D265D7A00702C32 /* Font.swift in Sources */,
D8E054DD2CF1AF89006B1879 /* View.swift in Sources */,
5BF33BF52CE70E37006F17EC /* Color.swift in Sources */,
);
Expand Down Expand Up @@ -744,6 +781,7 @@
5BE1BF082CF867590082648D /* NotificationManager.swift in Sources */,
D801A1BA2CF2213C00AD0D64 /* BusDataMock.swift in Sources */,
D876BF312CECE89E0098B68E /* OnboardingView.swift in Sources */,
D8BD64B72D265D7A00702C32 /* Font.swift in Sources */,
D8C5E7322D006D31005FE865 /* LoadingView.swift in Sources */,
5B64AF952CCF823D0083CA23 /* BusInfoEnum.swift in Sources */,
D82CB2342CFE103800A93217 /* UIApplication.swift in Sources */,
Expand Down
11 changes: 7 additions & 4 deletions TMT/TMT/BusJourneyScanned/Views/NotUploadedView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,21 @@ struct NotUploadedView: View {
ZStack {
VStack(spacing: 0) {
HStack {
Text("Don't worry\nRide comfortably")
.foregroundStyle(.textDefault)
Text("Dont worry\nRide comfortably")
.title1Bold()
.font(.system(size: 28, weight: .bold))

Spacer()
}
.padding(.bottom, 10)

HStack(spacing: 0) {
Text("We will let you know\nthe exact location to get off.")
.title4()
.padding(.bottom, 10)
.foregroundStyle(.brandPrimary)
.font(.system(size: 20, weight: .bold))
.multilineTextAlignment(.leading)

Spacer()
}

Expand All @@ -52,8 +54,9 @@ struct NotUploadedView: View {
.aspectRatio(1.0, contentMode: .fit)
HStack(alignment: .center, spacing: 8) {
Image(systemName: "photo")

Text("Upload Screenshot")
.font(.system(size: 18))
.body1()
}
.foregroundStyle(.yellow600)
}
Expand Down
5 changes: 3 additions & 2 deletions TMT/TMT/BusJourneyScanned/Views/ScannedJourneyInfoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ struct ScannedJourneyInfoView: View {
private func uploadedInfoBox(title: String, scannedInfo: Binding<String>) -> some View {
VStack(alignment: .leading) {
Text("\(title)")
.label1Medium()
.foregroundStyle(.grey300)
.font(.system(size: 14, weight: .medium))

TextField("\(scannedInfo.wrappedValue)", text: scannedInfo)
.font(.custom("Pretendard", size: 20).bold())
.foregroundStyle(.textDefault)
.font(.system(size: 20, weight: .bold))
.padding(12)
.frame(maxWidth: .infinity, alignment: .center)
.background(
Expand All @@ -193,4 +193,5 @@ struct ScannedJourneyInfoView: View {

#Preview {
ScannedJourneyInfoView(path: .constant(["ScannedJourneyInfoView"]))
.environmentObject(ImageHandlerModel())
}
188 changes: 188 additions & 0 deletions TMT/TMT/Extension/Font.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
//
// Font.swift
// TMT
//
// Created by 김유빈 on 1/2/25.
//

import SwiftUI

extension Text {
/// 공통 스타일 적용 함수
private func applyTextStyle(
fontName: String,
fontSize: CGFloat,
figmaLetterSpacing: CGFloat,
figmaLineHeight: CGFloat
) -> some View {
let trackingValue = (figmaLetterSpacing / 100) * fontSize
let lineSpacingValue = max(figmaLineHeight - fontSize - 4, 0)

return self
.font(.custom(fontName, size: fontSize))
.tracking(trackingValue)
.lineSpacing(lineSpacingValue)
.padding(.vertical, lineSpacingValue / 2)
.frame(minHeight: max(figmaLineHeight - 4, fontSize))
}

/// Title0-SemiBold
func title0SemiBold() -> some View {
applyTextStyle(
fontName: "Pretendard-SemiBold",
fontSize: 45,
figmaLetterSpacing: 0,
figmaLineHeight: 40
)
}

/// Title1-Bold
func title1Bold() -> some View {
applyTextStyle(
fontName: "Pretendard-Bold",
fontSize: 28,
figmaLetterSpacing: -0.2,
figmaLineHeight: 33.4
)
}

/// Title1-SemiBold
func title1SemiBold() -> some View {
applyTextStyle(
fontName: "Pretendard-SemiBold",
fontSize: 28,
figmaLetterSpacing: -0.2,
figmaLineHeight: 33.4
)
}

/// Title2
func title2() -> some View {
applyTextStyle(
fontName: "Pretendard-Bold",
fontSize: 24,
figmaLetterSpacing: -0.2,
figmaLineHeight: 29
)
}

/// Title3
func title3() -> some View {
applyTextStyle(
fontName: "Pretendard-Bold",
fontSize: 22,
figmaLetterSpacing: -0.2,
figmaLineHeight: 26
)
}

/// Title4
func title4() -> some View {
applyTextStyle(
fontName: "Pretendard-Bold",
fontSize: 20,
figmaLetterSpacing: -0.2,
figmaLineHeight: 26
)
}

/// Title5
func title5() -> some View {
applyTextStyle(
fontName: "Pretendard-Regular",
fontSize: 20,
figmaLetterSpacing: -0.45,
figmaLineHeight: 25
)
}

/// Body1
func body1() -> some View {
applyTextStyle(
fontName: "Pretendard-Medium",
fontSize: 18,
figmaLetterSpacing: -0.2,
figmaLineHeight: 23
)
}

/// Body2-Medium
func body2Medium() -> some View {
applyTextStyle(
fontName: "Pretendard-Medium",
fontSize: 16,
figmaLetterSpacing: 0,
figmaLineHeight: 21
)
}

/// Body2-Regular
func body2Regular() -> some View {
applyTextStyle(
fontName: "Pretendard-Regular",
fontSize: 16,
figmaLetterSpacing: 0,
figmaLineHeight: 21
)
}

/// Label1-SemiBold
func label1SemiBold() -> some View {
applyTextStyle(
fontName: "Pretendard-SemiBold",
fontSize: 14,
figmaLetterSpacing: 0,
figmaLineHeight: 19
)
}

/// Label1-Medium
func label1Medium() -> some View {
applyTextStyle(
fontName: "Pretendard-Medium",
fontSize: 14,
figmaLetterSpacing: 0,
figmaLineHeight: 19
)
}

/// Label1-Regular
func label1Regular() -> some View {
applyTextStyle(
fontName: "Pretendard-Regular",
fontSize: 14,
figmaLetterSpacing: 0,
figmaLineHeight: 19
)
}

/// Label2
func label2() -> some View {
applyTextStyle(
fontName: "Pretendard-Regular",
fontSize: 13,
figmaLetterSpacing: 0,
figmaLineHeight: 17
)
}

/// Label3-SemiBold
func label3SemiBold() -> some View {
applyTextStyle(
fontName: "Pretendard-SemiBold",
fontSize: 12,
figmaLetterSpacing: 0.2,
figmaLineHeight: 17
)
}

/// Label3-Regular
func label3Regular() -> some View {
applyTextStyle(
fontName: "Pretendard-Regular",
fontSize: 12,
figmaLetterSpacing: 0.2,
figmaLineHeight: 17
)
}
}
7 changes: 7 additions & 0 deletions TMT/TMT/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
<array>
<string>navermap</string>
</array>
<key>UIAppFonts</key>
<array>
<string>Pretendard-Bold.otf</string>
<string>Pretendard-Medium.otf</string>
<string>Pretendard-Regular.otf</string>
<string>Pretendard-SemiBold.otf</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
Expand Down
4 changes: 2 additions & 2 deletions TMT/TMT/Loading/Views/LoadingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ struct LoadingView: View {
VStack(spacing: 0) {
HStack {
Text(currentLoading.description)
.foregroundStyle(.textDefault)
.font(.system(size: 28, weight: .bold))
.title1Bold()
.foregroundStyle(.basicBlack)

Spacer()
}
Expand Down
Loading

0 comments on commit 83bd59c

Please sign in to comment.