Skip to content

Commit

Permalink
[Feat] Team-ShortcutsZip#528 - ReadShortcutView UI 구현
Browse files Browse the repository at this point in the history
- SF Compact Rounded 폰트 추가
- SF Compact Rounded 폰트 선언
- ReadShortcutView에서 선언되는 폰트 선언
  • Loading branch information
JMM00 committed May 2, 2024
1 parent 7d9ce8c commit 8b503f3
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 1 deletion.
11 changes: 11 additions & 0 deletions HappyAnding/HappyAnding/Extensions/View/View+Font.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ enum Pretendard: String {
case bold = "Pretendard-Bold"
}

enum SFCompactRounded: String {
case regular = "SF-Compact-Rounded-Regular"
case medium = "SF-Compact-Rounded-Medium"
case semiBold = "SF-Compact-Rounded-Semibold"
case bold = "SF-Compact-Rounded-Bold"
}

///Pretendard 폰트를 기존 modifier와 같이 사용할 수 있게 해 주는 Extension
///사용 예시
///Text("단축어").largeTitle()
Expand Down Expand Up @@ -55,6 +62,10 @@ extension View {
func customPretendard(fontName: Pretendard, size: CGFloat) -> some View {
self.modifier(CustomFontStyle(fontName: fontName.rawValue, size: size))
}

func customSFCompactRounded(fontName: SFCompactRounded, size: CGFloat) -> some View {
self.modifier(CustomFontStyle(fontName: fontName.rawValue, size: size))
}
}

struct CustomFontStyle: ViewModifier {
Expand Down
20 changes: 19 additions & 1 deletion HappyAnding/HappyAnding/Extensions/View/View+UIFont.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,27 @@ extension View {
func smallShortcutIcon() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .smallShortcutIcon, lineHeight: 20))
}
func regular16() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: UIFont(name: Pretendard.regular.rawValue, size: 16) ?? UIFont.systemFont(ofSize: 16), lineHeight: 24))
}
func medium16() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: UIFont(name: Pretendard.medium.rawValue, size: 16) ?? UIFont.systemFont(ofSize: 16), lineHeight: 24))
}
func medium17() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: UIFont(name: Pretendard.medium.rawValue, size: 17) ?? UIFont.systemFont(ofSize: 17), lineHeight: 24))
}
func semiBold17() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: UIFont(name: Pretendard.semiBold.rawValue, size: 17) ?? UIFont.systemFont(ofSize: 17), lineHeight: 24))
}
func numRegular16() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: UIFont(name: SFCompactRounded.regular.rawValue, size: 16) ?? UIFont.systemFont(ofSize: 16), lineHeight: 24))
}

func descriptionReadable() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: UIFont(name: Pretendard.regular.rawValue, size: 16) ?? UIFont.systemFont(ofSize: 16), lineHeight: 24))
}
}


// MARK: - View Modifier
/**
자간을 위한 View Modifier입니다.
Expand Down
4 changes: 4 additions & 0 deletions HappyAnding/HappyAnding/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
<string>Pretendard-SemiBold.otf</string>
<string>Pretendard-Medium.otf</string>
<string>Pretendard-Regular.otf</string>
<string>SF-Compact-Rounded-Bold.otf</string>
<string>SF-Compact-Rounded-Semibold.otf</string>
<string>SF-Compact-Rounded-Medium.otf</string>
<string>SF-Compact-Rounded-Regular.otf</string>
</array>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 8b503f3

Please sign in to comment.