-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
157 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
import SwiftUI | ||
|
||
public struct SopoFont { | ||
public enum Pretendard { case thin, extraLight, light, regular, medium, semibold, bold, extraBold, black } | ||
init() { | ||
Pretendard.allCases.forEach { item in | ||
item.loadFont() | ||
} | ||
} | ||
|
||
public enum Pretendard: CaseIterable { case thin, extraLight, light, regular, medium, semibold, bold, extraBold, black } | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import SwiftUI | ||
|
||
extension SopoTextStyle.Title1: SopoFont.Fontable { | ||
public var font: Font { | ||
switch self { | ||
case .bold: | ||
.pretendard(.extraBold, size: 32) | ||
case .medium: | ||
.pretendard(.medium, size: 32) | ||
case .regular: | ||
.pretendard(.regular, size: 32) | ||
} | ||
} | ||
} | ||
|
||
extension SopoTextStyle.Title2: SopoFont.Fontable { | ||
public var font: Font { | ||
switch self { | ||
case .bold: | ||
.pretendard(.bold, size: 28) | ||
case .medium: | ||
.pretendard(.medium, size: 28) | ||
case .regular: | ||
.pretendard(.regular, size: 28) | ||
} | ||
} | ||
} | ||
|
||
extension SopoTextStyle.Headline1: SopoFont.Fontable { | ||
public var font: Font { | ||
switch self { | ||
case .bold: | ||
.pretendard(.bold, size: 24) | ||
case .medium: | ||
.pretendard(.medium, size: 24) | ||
case .regular: | ||
.pretendard(.regular, size: 24) | ||
} | ||
} | ||
} | ||
|
||
extension SopoTextStyle.Headline2: SopoFont.Fontable { | ||
public var font: Font { | ||
switch self { | ||
case .bold: | ||
.pretendard(.bold, size: 20) | ||
case .medium: | ||
.pretendard(.medium, size: 20) | ||
case .regular: | ||
.pretendard(.regular, size: 20) | ||
} | ||
} | ||
} | ||
|
||
extension SopoTextStyle.Body: SopoFont.Fontable { | ||
public var font: Font { | ||
switch self { | ||
case .bold: | ||
.pretendard(.bold, size: 16) | ||
case .medium: | ||
.pretendard(.medium, size: 16) | ||
case .regular: | ||
.pretendard(.regular, size: 16) | ||
} | ||
} | ||
} | ||
|
||
|
||
extension SopoTextStyle.Label: SopoFont.Fontable { | ||
public var font: Font { | ||
switch self { | ||
case .bold: | ||
.pretendard(.bold, size: 14) | ||
case .medium: | ||
.pretendard(.medium, size: 14) | ||
case .regular: | ||
.pretendard(.regular, size: 14) | ||
} | ||
} | ||
} | ||
|
||
extension SopoTextStyle.Caption: SopoFont.Fontable { | ||
public var font: Font { | ||
switch self { | ||
case .bold: | ||
.pretendard(.bold, size: 12) | ||
case .medium: | ||
.pretendard(.medium, size: 12) | ||
case .regular: | ||
.pretendard(.regular, size: 12) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import SwiftUI | ||
|
||
public struct SopoTextStyle { | ||
|
||
public enum Title1 { case bold, medium, regular } | ||
public enum Title2 { case bold, medium, regular } | ||
|
||
public enum Headline1 { case bold, medium, regular } | ||
public enum Headline2 { case bold, medium, regular } | ||
|
||
public enum Body { case bold, medium, regular } | ||
|
||
public enum Label { case bold, medium, regular } | ||
|
||
public enum Caption { case bold, medium, regular } | ||
|
||
} |