Skip to content

Commit

Permalink
💄 Add Font System
Browse files Browse the repository at this point in the history
  • Loading branch information
uuuunseo committed Aug 27, 2024
1 parent 553a291 commit 419c8b3
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//
// Font+Ondosee.swift
// DesignSystem
//
// Created by 정윤서 on 8/28/24.
// Copyright © 2024 com. All rights reserved.
//
import SwiftUI

import Foundation
public extension Font {
enum OndoseeFontSystem {
case system
case freesentation
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
//
// FontWeight+Ext.swift
// DesignSystem
//
// Created by 정윤서 on 8/27/24.
// Copyright © 2024 com. All rights reserved.
//
import SwiftUI

import Foundation
public extension Font {
static func regular(_ style: Font.OndoseeFontSystem, size: CGFloat.OndoseeFontStyle) -> Font {
switch style {
case .system: return .system(size: size.size, weight: .regular)
case .freesentation: return DesignSystemFontFamily.Freesentation._4Regular.swiftUIFont(size: size.size)
}
}

static func medium(_ style: Font.OndoseeFontSystem, size: CGFloat.OndoseeFontStyle) -> Font {
switch style {
case .system: return .system(size: size.size, weight: .medium)
case .freesentation: return DesignSystemFontFamily.Freesentation._5Medium.swiftUIFont(size: size.size)
}
}

static func bold(_ style: Font.OndoseeFontSystem, size: CGFloat.OndoseeFontStyle) -> Font {
switch style {
case .system: return .system(size: size.size, weight: .bold)
case .freesentation: return DesignSystemFontFamily.Freesentation._7Bold.swiftUIFont(size: size.size)
}
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
import Foundation

public extension CGFloat {
enum OndoseeFontStyle {
case title1
case title2
case title3
case text1
case text2
case text3
case caption
}
}

public extension CGFloat.OndoseeFontStyle {
var size: CGFloat {
switch self {
case .title1: return 30
case .title2: return 25
case .title3: return 20
case .text1: return 17
case .text2: return 15
case .text3: return 13
case .caption: return 10
}
}
}

0 comments on commit 419c8b3

Please sign in to comment.