Skip to content

Commit

Permalink
[Setting] #239 SwiftUI에서 사용할 Font 적용 extension 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
isakatty committed Apr 17, 2024
1 parent b75e7de commit 2da5929
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Projects/App/Widget/NearByStop/View/NearByStopView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,23 @@ struct NearByStopView: View {
let entry: NearByStopProvider.Entry

var body: some View {
VStack {
VStack(alignment: .leading) {
Spacer()
HStack {
VStack(alignment: .leading) {
Text("주변")
Text("정류장")
}
.font(.nanumHeavySU(size: 20))

Spacer()
}
Spacer()

Text(entry.busStopName)
.font(.nanumRegularSU(size: 16))
Text("\(entry.distance)m")
.font(.nanumExtraBoldSU(size: 16))
}
.widgetBackground(Color.white)
}
Expand Down
33 changes: 33 additions & 0 deletions Projects/DesignSystem/Sources/Font+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// Font+.swift
// DesignSystem
//
// Created by Jisoo HAM on 4/17/24.
// Copyright © 2024 Pepsi-Club. All rights reserved.
//

import SwiftUI

public extension Font {
typealias Nanum = DesignSystemFontFamily.NanumSquareNeoOTF

static func nanumLightSU(size: CGFloat) -> Font {
Nanum.light.swiftUIFont(size: size)
}

static func nanumRegularSU(size: CGFloat) -> Font {
Nanum.regular.swiftUIFont(size: size)
}

static func nanumBoldSU(size: CGFloat) -> Font {
Nanum.bold.swiftUIFont(size: size)
}

static func nanumExtraBoldSU(size: CGFloat) -> Font {
Nanum.extraBold.swiftUIFont(size: size)
}

static func nanumHeavySU(size: CGFloat) -> Font {
Nanum.heavy.swiftUIFont(size: size)
}
}

0 comments on commit 2da5929

Please sign in to comment.