Skip to content

Commit

Permalink
[Feat] #46 - Modify Font+Extension for SFsymbols
Browse files Browse the repository at this point in the history
  • Loading branch information
HanGyeongjun committed Feb 27, 2023
1 parent 3ab6eff commit f3c0102
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions HappyAnding/HappyAnding/Extensions/Font+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ extension UIFont {
static var Subtitle = UIFont.systemFont(ofSize: 15, weight: .heavy)
static var Footnote = UIFont.systemFont(ofSize: 13, weight: .regular)
static var Sb = UIFont.systemFont(ofSize: 15, weight: .semibold)

static var MediumIcon = UIFont.systemFont(ofSize: 20, weight: .medium)
static var SmallIcon = UIFont.systemFont(ofSize: 14, weight: .regular)
static var LargeShortcutIcon = UIFont.systemFont(ofSize: 32, weight: .medium)
static var MediumShortcutIcon = UIFont.systemFont(ofSize: 26, weight: .medium)
static var SmallShortcutIcon = UIFont.systemFont(ofSize: 16, weight: .medium)
}

//출처: https://stackoverflow.com/questions/61705184/how-to-set-line-height-for-a-single-line-text-in-swiftui
Expand Down Expand Up @@ -61,4 +67,20 @@ extension View {
func Sb() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .Sb, lineHeight: 20))
}

func MediumIcon() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .MediumIcon, lineHeight: 24))
}
func SmallIcon() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .SmallIcon, lineHeight: 16))
}
func LargeShortcutIcon() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .LargeShortcutIcon, lineHeight: 36))
}
func MediumShortcutIcon() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .MediumShortcutIcon, lineHeight: 30))
}
func SmallShortcutIcon() -> some View {
ModifiedContent(content: self, modifier: FontWithLineHeight(font: .SmallShortcutIcon, lineHeight: 20))
}
}

0 comments on commit f3c0102

Please sign in to comment.