Skip to content

Commit

Permalink
feat: SUIT -> Pretendard
Browse files Browse the repository at this point in the history
  • Loading branch information
hhhello0507 committed Jul 26, 2024
1 parent 96689cd commit 2d35e3a
Show file tree
Hide file tree
Showing 45 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Source/DDS/Component/Button/Button/Button.swift
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private struct ButtonPreview: View {
}
}
.padding()
.registerSUIT()
.registerPretendard()
}
}

Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Component/Button/SegmentedButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private struct SegmentedButtonPreview: View {
DodamSegmentedButton(labels: ["외출", "외박"], selection: .constant(0))
.padding(.horizontal, 16)
}
.registerSUIT()
.registerPretendard()
}
}

Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Component/Button/TextButton/TextButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private struct ButtonPreview: View {
}
}
.padding()
.registerSUIT()
.registerPretendard()
}
}

Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Component/CheckBox/Checkbox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public struct DodamCheckbox: View {
}
.padding(16)
.background(DodamColor.Background.normal)
.registerSUIT()
.registerPretendard()
}
}
return CheckboxPreview()
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Component/EmptyView/EmptyView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private struct DodamContainerPreview: View {
}
.padding(16)
.background(DodamColor.Background.neutral)
.registerSUIT()
.registerPretendard()
}
}

Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Component/LoadingView/LoadingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ public struct DodamLoadingView: View {

#Preview {
DodamLoadingView()
.registerSUIT()
.registerPretendard()
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public struct DodamDialogPresenter<C: View>: ModalViewProtocol {
}
}
}
.registerSUIT()
.registerPretendard()
}
}
return DialogPreview()
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Component/NavigationView/NavigationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ public struct DodamNavigationView<C: View>: DodamNavigationViewProtocol {
}
.button(icon: .plus) { }
.button(icon: .bell) { }
.registerSUIT()
.registerPretendard()
}
2 changes: 1 addition & 1 deletion Source/DDS/Component/PageView/PageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public struct DodamPageView: View {
}
.frame(height: 50)
.padding()
.registerSUIT()
.registerPretendard()
}
}
return DodamPagePreview()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public struct DodamCircularProgressView: View {
.tint(.gray)
}
.padding()
.registerSUIT()
.registerPretendard()
}
}
return DodamCircularProgressPreview()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public struct DodamLinearProgressView: View {
.tint(.gray)
}
.padding()
.registerSUIT()
.registerPretendard()
}
}
return DodamLinearProgressPreview()
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Component/ScrollView/ScrollView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ public struct DodamScrollView<C: View>: DodamNavigationViewProtocol {
}
.button(icon: .plus) { }
.button(icon: .bell) { }
.registerSUIT()
.registerPretendard()
}
4 changes: 2 additions & 2 deletions Source/DDS/Component/Sheet/Sheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public struct DodamSheet<C: View, V: View>: View {
.dodamSheet(isPresented: $isPresented) {
Text("Presented")
}
.registerSUIT()
.registerPretendard()
}
}
return DodamSheetPreview()
Expand All @@ -128,7 +128,7 @@ public struct DodamSheet<C: View, V: View>: View {
DatePicker("", selection: $date)
.datePickerStyle(.wheel)
}
.registerSUIT()
.registerPretendard()
}
}
return DodamSheetPreview()
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Component/Shimmer/Shimmer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ public struct DodamShimmer<C: View>: View {
.frame(width: 100, height: 100)
}
.shimmer()
.registerSUIT()
.registerPretendard()
}
2 changes: 1 addition & 1 deletion Source/DDS/Component/TabView/TabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private struct DodamPagePreview: View {
Text("Menu")
.page(.icon(.menu))
}
.registerSUIT()
.registerPretendard()
.background(DodamColor.Background.neutral)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Component/Tag/Tag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public struct DodamTag: View {
private struct TagPreview: View {

init() {
SUIT.register()
Pretendard.register()
}

var body: some View {
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Component/TextField/TextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public struct DodamTextField: View {
)
}
.padding()
.registerSUIT()
.registerPretendard()
}
}
return DodamTextFieldPreview()
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Component/Toast/Toast.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public struct DodamToast<C: View, V: View>: View {
) {
Text("Hello, world!")
}
.registerSUIT()
.registerPretendard()
}
}
return DodamToastPreview()
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Component/TopAppBar/TopAppBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,5 @@ public struct DodamTopAppBar: View {
.button(icon: .bell) { }
Divider()
}
.registerSUIT()
.registerPretendard()
}
2 changes: 1 addition & 1 deletion Source/DDS/Component/TopTabView/TopTabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private struct DodamTopTabPreview: View {
Text("MY")
.page(.text("MY"))
}
.registerSUIT()
.registerPretendard()
}
}

Expand Down
4 changes: 2 additions & 2 deletions Source/DDS/Foundation/Typography/Extension/FontExt.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import SwiftUI
public extension Font {

init(_ dodamTypography: DodamTypography) {
self = .suit(
self = .pretendard(
size: dodamTypography.size,
weight: dodamTypography.weight
)
}

static func suit(size: CGFloat, weight: SUIT.Weight) -> Font {
static func pretendard(size: CGFloat, weight: Pretendard.Weight) -> Font {
custom(weight.rawValue, fixedSize: size)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import SwiftUI

@available(macOS 12, iOS 15, *)
public struct SUIT {
public struct Pretendard {

public enum Weight: String, CaseIterable {

case regular = "SUIT-Regular"
case medium = "SUIT-Medium"
case semibold = "SUIT-SemiBold"
case bold = "SUIT-Bold"
case extrabold = "SUIT-ExtraBold"
case regular = "Pretendard-Regular"
case medium = "Pretendard-Medium"
case semibold = "Pretendard-SemiBold"
case bold = "Pretendard-Bold"
case extrabold = "Pretendard-ExtraBold"
}

public static func register() {
SUIT.Weight.allCases.forEach {
Pretendard.Weight.allCases.forEach {
guard let fontURL = Bundle.module.url(
forResource: $0.rawValue,
withExtension: "otf"
Expand Down
8 changes: 4 additions & 4 deletions Source/DDS/Foundation/Typography/Extension/ViewExt.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import SwiftUI
@available(macOS 12, iOS 15, *)
public extension View {

func registerSUIT() -> some View {
SUIT.register()
func registerPretendard() -> some View {
Pretendard.register()
return self
}
}
Expand Down Expand Up @@ -81,7 +81,7 @@ public extension View {

#Preview {
let str = "스마트 스쿨 플랫폼 도담도담도담\n바인드는 우주 최강 동아리입니다"
SUIT.register()
Pretendard.register()
return (
ScrollView {
VStack(spacing: 44) {
Expand Down Expand Up @@ -191,7 +191,7 @@ public extension View {

#Preview {
VStack {
let _ = SUIT.register()
let _ = Pretendard.register()
let headline = DodamHeadline(weight: .bold)
let font = Font(headline)
let uiFont = UIFont.uiFontGuide(headline)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Source/DDS/Foundation/Typography/Font/SUIT-Bold.otf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Source/DDS/Foundation/Typography/Type/Body1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftUI
public struct DodamBody1: DodamTypography {

public let size: CGFloat = 16
public let weight: SUIT.Weight
public let weight: Pretendard.Weight
public let lineHeight: Double = 1.5

public static let bold: Self = .init(weight: .semibold)
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Foundation/Typography/Type/Body2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftUI
public struct DodamBody2: DodamTypography {

public let size: CGFloat = 15
public let weight: SUIT.Weight
public let weight: Pretendard.Weight
public let lineHeight: Double = 1.5

public static let bold: Self = .init(weight: .semibold)
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Foundation/Typography/Type/Caption1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftUI
public struct DodamCaption1: DodamTypography {

public let size: CGFloat = 13
public let weight: SUIT.Weight
public let weight: Pretendard.Weight
public let lineHeight: Double = 1.3

public static let bold: Self = .init(weight: .semibold)
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Foundation/Typography/Type/Caption2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftUI
public struct DodamCaption2: DodamTypography {

public let size: CGFloat = 12
public let weight: SUIT.Weight
public let weight: Pretendard.Weight
public let lineHeight: Double = 1.3

public static let bold: Self = .init(weight: .semibold)
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Foundation/Typography/Type/Heading1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftUI
public struct DodamHeading1: DodamTypography {

public let size: CGFloat = 22
public let weight: SUIT.Weight
public let weight: Pretendard.Weight
public let lineHeight: Double = 1.3

public static let bold: Self = .init(weight: .extrabold)
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Foundation/Typography/Type/Heading2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftUI
public struct DodamHeading2: DodamTypography {

public let size: CGFloat = 20
public let weight: SUIT.Weight
public let weight: Pretendard.Weight
public let lineHeight: Double = 1.4

public static let bold: Self = .init(weight: .extrabold)
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Foundation/Typography/Type/Headline.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftUI
public struct DodamHeadline: DodamTypography {

public let size: CGFloat = 18
public let weight: SUIT.Weight
public let weight: Pretendard.Weight
public let lineHeight: Double = 1.5

public static let bold: Self = .init(weight: .bold)
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Foundation/Typography/Type/Label.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftUI
public struct DodamLabel: DodamTypography {

public let size: CGFloat = 14
public let weight: SUIT.Weight
public let weight: Pretendard.Weight
public let lineHeight: Double = 1.4

public static let bold: Self = .init(weight: .semibold)
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Foundation/Typography/Type/Title1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftUI
public struct DodamTitle1: DodamTypography {

public let size: CGFloat = 36
public let weight: SUIT.Weight
public let weight: Pretendard.Weight
public let lineHeight: Double = 1.3

public static let bold: Self = .init(weight: .extrabold)
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Foundation/Typography/Type/Title2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftUI
public struct DodamTitle2: DodamTypography {

public let size: CGFloat = 28
public let weight: SUIT.Weight
public let weight: Pretendard.Weight
public let lineHeight: Double = 1.3

public static let bold: Self = .init(weight: .extrabold)
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Foundation/Typography/Type/Title3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftUI
public struct DodamTitle3: DodamTypography {

public let size: CGFloat = 24
public let weight: SUIT.Weight
public let weight: Pretendard.Weight
public let lineHeight: Double = 1.3

public static let bold: Self = .init(weight: .extrabold)
Expand Down
2 changes: 1 addition & 1 deletion Source/DDS/Foundation/Typography/Typography.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftUI
public protocol DodamTypography {

var size: CGFloat { get }
var weight: SUIT.Weight { get }
var weight: Pretendard.Weight { get }
var lineHeight: Double { get } // percentage
}

Expand Down

0 comments on commit 2d35e3a

Please sign in to comment.