Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x10",
"green" : "0x0F",
"red" : "0x0F"
"blue" : "0x15",
"green" : "0x14",
"red" : "0x14"
}
},
"idiom" : "universal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xB5",
"green" : "0xD2",
"blue" : "0xBA",
"green" : "0xD3",
"red" : "0xFF"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x91",
"green" : "0xBD",
"blue" : "0x98",
"green" : "0xBE",
"red" : "0xFF"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xA1",
"green" : "0xC0",
"blue" : "0xE9",
"green" : "0xF1",
"red" : "0xFF"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x5E",
"green" : "0x9F",
"red" : "0xFF"
"blue" : "0x6A",
"green" : "0xA0",
"red" : "0xFE"
}
},
"idiom" : "universal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x3F",
"green" : "0x8C",
"red" : "0xFF"
"blue" : "0x4D",
"green" : "0x8D",
"red" : "0xFE"
}
},
"idiom" : "universal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xE7",
"green" : "0xF1",
"blue" : "0xE4",
"green" : "0xEE",
"red" : "0xFF"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x0F",
"green" : "0x6F",
"red" : "0xFF"
"blue" : "0x20",
"green" : "0x71",
"red" : "0xFE"
}
Comment on lines +8 to 11

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

브랜드 핵심 톤(Orange500) 접근성 대비 확인 권장

  • 값 자체는 문제 없고 변경 취지에도 부합해 보입니다.
  • 텍스트/아이콘 포그라운드 또는 배경으로 사용 시 WCAG 대비(AA/AAA) 충족 여부를 확인해 주세요.

아래 스크립트로 #FE7120과 흰/검 텍스트 대비비를 계산할 수 있습니다:

결과가 본문 텍스트(AA: 4.5:1, 대형 텍스트: 3:1) 기준을 만족하는지 확인해 주세요.


🏁 Script executed:

#!/bin/bash
python - << 'PY'
# 계산 대상: #FE7120
import math

def hex_to_rgb(hexstr):
    hexstr = hexstr.lstrip('#')
    return tuple(int(hexstr[i:i+2], 16) for i in (0, 2, 4))

def lin(c):  # sRGB to linear
    c = c/255.0
    return c/12.92 if c <= 0.04045 else ((c+0.055)/1.055)**2.4

def rel_lum(rgb):
    r,g,b = (lin(c) for c in rgb)
    return 0.2126*r + 0.7152*g + 0.0722*b

def contrast(fg, bg):
    L1, L2 = sorted([rel_lum(fg), rel_lum(bg)], reverse=True)
    return (L1 + 0.05) / (L2 + 0.05)

orange = hex_to_rgb("#FE7120")
white = (255,255,255)
black = (0,0,0)

print("Contrast vs WHITE:", round(contrast(orange, white), 2))
print("Contrast vs BLACK:", round(contrast(orange, black), 2))
PY

Length of output: 57


Orange500 접근성 대비 결과 확인 및 개선 필요

검증 스크립트 실행 결과:

  • 흰색 텍스트 대비: 2.76:1 (WCAG AA 기준 4.5:1 미충족)
  • 검정색 텍스트 대비: 7.6:1 (WCAG AAA 기준 7:1 충족)

따라서 Orange500(#FE7120)을 전경(텍스트/아이콘) 또는 배경으로 사용할 때 다음을 반영해 주세요:

  • 흰색 텍스트 사용 시 대비 기준을 충족하지 못하므로,
    • 백그라운드 컬러를 어둡게 조정하거나
    • 대체 컬러 사용 검토
  • 검정색 텍스트 사용 시 적합(AA/AAA 모두 충족)

수정 위치:

  • Projects/Presentation/Resources/Colors.xcassets/Orange/Orange500.colorset/Contents.json (Lines 8–11)
🤖 Prompt for AI Agents
In
Projects/Presentation/Resources/Colors.xcassets/Orange/Orange500.colorset/Contents.json
around lines 8 to 11, the current Orange500 color (#FE7120) does not meet WCAG
AA contrast ratio of 4.5:1 against white text. To fix this, adjust the RGB
values to darken the orange shade so that white text contrast ratio meets or
exceeds 4.5:1, or consider replacing Orange500 with an alternative color that
satisfies this contrast requirement for white text usage.

},
"idiom" : "universal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x0E",
"green" : "0x65",
"red" : "0xE8"
"blue" : "0x1D",
"green" : "0x67",
"red" : "0xE7"
Comment thread
choijungp marked this conversation as resolved.
}
},
"idiom" : "universal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x0B",
"green" : "0x4F",
"red" : "0xB5"
"blue" : "0x17",
"green" : "0x50",
"red" : "0xB4"
}
},
"idiom" : "universal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x08",
"green" : "0x3D",
"blue" : "0x12",
"green" : "0x3E",
"red" : "0x8C"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x06",
"blue" : "0x0D",
"green" : "0x2F",
"red" : "0x6B"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,6 @@ enum BitnagilColor {
static let kakao = UIColor(named: "Kakao", in: bundle, compatibleWith: nil)
static let error = UIColor(named: "Error", in: bundle, compatibleWith: nil)

// MARK: - Gradient
static let gradientLeft = UIColor(named: "GradientLeft", in: bundle, compatibleWith: nil)
static let gradientRight = UIColor(named: "GradientRight", in: bundle, compatibleWith: nil)
static let homeGradientLeft = UIColor(named: "HomeGradientLeft", in: bundle, compatibleWith: nil)
static let homeGradientRight = UIColor(named: "HomeGradientRight", in: bundle, compatibleWith: nil)

// MARK: - Emotion Colors
static let happy = UIColor(named: "EmotionHappy", in: bundle, compatibleWith: nil)
static let lethargy = UIColor(named: "EmotionLethargy", in: bundle, compatibleWith: nil)
static let lonely = UIColor(named: "EmotionLonely", in: bundle, compatibleWith: nil)
static let sad = UIColor(named: "EmotionSad", in: bundle, compatibleWith: nil)
static let anxiety = UIColor(named: "EmotionAnxiety", in: bundle, compatibleWith: nil)

// MARK: - Gray Colors
static let gray5 = UIColor(named: "Gray5", in: bundle, compatibleWith: nil)
static let gray7 = UIColor(named: "Gray7", in: bundle, compatibleWith: nil)
Expand All @@ -46,6 +33,26 @@ enum BitnagilColor {
static let gray98 = UIColor(named: "Gray98", in: bundle, compatibleWith: nil)
static let gray99 = UIColor(named: "Gray99", in: bundle, compatibleWith: nil)

// MARK: - Orange Colors
static let orange25 = UIColor(named: "Orange25", in: bundle, compatibleWith: nil)
static let orange50 = UIColor(named: "Orange50", in: bundle, compatibleWith: nil)
static let orange100 = UIColor(named: "Orange100", in: bundle, compatibleWith: nil)
static let orange200 = UIColor(named: "Orange200", in: bundle, compatibleWith: nil)
static let orange300 = UIColor(named: "Orange300", in: bundle, compatibleWith: nil)
static let orange400 = UIColor(named: "Orange400", in: bundle, compatibleWith: nil)
static let orange500 = UIColor(named: "Orange500", in: bundle, compatibleWith: nil)
static let orange600 = UIColor(named: "Orange600", in: bundle, compatibleWith: nil)
static let orange700 = UIColor(named: "Orange700", in: bundle, compatibleWith: nil)
static let orange800 = UIColor(named: "Orange800", in: bundle, compatibleWith: nil)
static let orange900 = UIColor(named: "Orange900", in: bundle, compatibleWith: nil)

// TODO: 제거될 색상들
// MARK: - Gradient
static let gradientLeft = UIColor(named: "GradientLeft", in: bundle, compatibleWith: nil)
static let gradientRight = UIColor(named: "GradientRight", in: bundle, compatibleWith: nil)
static let homeGradientLeft = UIColor(named: "HomeGradientLeft", in: bundle, compatibleWith: nil)
static let homeGradientRight = UIColor(named: "HomeGradientRight", in: bundle, compatibleWith: nil)

Comment on lines +49 to +55

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

TODO 경고 제거 및 단계적 제거를 위한 @available(deprecated) 적용 권고

SwiftLint TODO 경고가 발생합니다. 주석을 Deprecated 표기로 바꾸고 각 상수에 deprecate 어노테이션을 부여하면 마이그레이션 추적과 사용 억제가 좋아집니다.

아래 diff 제안:

-    // TODO: 제거될 색상들
-    // MARK: - Gradient
-    static let gradientLeft = UIColor(named: "GradientLeft", in: bundle, compatibleWith: nil)
-    static let gradientRight = UIColor(named: "GradientRight", in: bundle, compatibleWith: nil)
-    static let homeGradientLeft = UIColor(named: "HomeGradientLeft", in: bundle, compatibleWith: nil)
-    static let homeGradientRight = UIColor(named: "HomeGradientRight", in: bundle, compatibleWith: nil)
+    // MARK: - Deprecated: 제거 예정 색상들 (v1 전용)
+    // MARK: - Gradient
+    @available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
+    static let gradientLeft = UIColor(named: "GradientLeft", in: bundle, compatibleWith: nil)
+    @available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
+    static let gradientRight = UIColor(named: "GradientRight", in: bundle, compatibleWith: nil)
+    @available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
+    static let homeGradientLeft = UIColor(named: "HomeGradientLeft", in: bundle, compatibleWith: nil)
+    @available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
+    static let homeGradientRight = UIColor(named: "HomeGradientRight", in: bundle, compatibleWith: nil)

현재 사용처 파악을 위해 간단 스캔 스크립트도 첨부합니다.


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Deprecated(Gradient) 사용처 스캔 =="
rg -n 'BitnagilColor\.(gradientLeft|gradientRight|homeGradientLeft|homeGradientRight)\b' -S || echo "사용처 없음(또는 스캔 결과 없음)"

Length of output: 787


@available(deprecated) 적용 권고 및 사용처 안내

아래 색상 상수에 @available(*, deprecated…) 어노테이션을 추가하면 SwiftLint TODO 경고가 사라지고, 사용 시 경고를 통해 단계적 제거를 관리할 수 있습니다.

— 사용처 스캔 결과

  • Projects/Presentation/Sources/Onboarding/View/Component/GradientProgressView.swift:26–27
  • Projects/Presentation/Sources/Home/View/HomeView.swift:394–395

아래와 같이 변경해 주세요:

-    // TODO: 제거될 색상들
-    // MARK: - Gradient
-    static let gradientLeft = UIColor(named: "GradientLeft", in: bundle, compatibleWith: nil)
-    static let gradientRight = UIColor(named: "GradientRight", in: bundle, compatibleWith: nil)
-    static let homeGradientLeft = UIColor(named: "HomeGradientLeft", in: bundle, compatibleWith: nil)
-    static let homeGradientRight = UIColor(named: "HomeGradientRight", in: bundle, compatibleWith: nil)
+    // MARK: - Deprecated: 제거 예정 색상들 (v1 전용)
+    // MARK: - Gradient
+    @available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
+    static let gradientLeft = UIColor(named: "GradientLeft", in: bundle, compatibleWith: nil)
+    @available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
+    static let gradientRight = UIColor(named: "GradientRight", in: bundle, compatibleWith: nil)
+    @available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
+    static let homeGradientLeft = UIColor(named: "HomeGradientLeft", in: bundle, compatibleWith: nil)
+    @available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
+    static let homeGradientRight = UIColor(named: "HomeGradientRight", in: bundle, compatibleWith: nil)

이 변경 후 사용 위치에서 deprecation 경고를 확인하며 새로운 색상으로 교체를 진행해 주세요.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// TODO: 제거될 색상들
// MARK: - Gradient
static let gradientLeft = UIColor(named: "GradientLeft", in: bundle, compatibleWith: nil)
static let gradientRight = UIColor(named: "GradientRight", in: bundle, compatibleWith: nil)
static let homeGradientLeft = UIColor(named: "HomeGradientLeft", in: bundle, compatibleWith: nil)
static let homeGradientRight = UIColor(named: "HomeGradientRight", in: bundle, compatibleWith: nil)
// MARK: - Deprecated: 제거 예정 색상들 (v1 전용)
// MARK: - Gradient
@available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
static let gradientLeft = UIColor(named: "GradientLeft", in: bundle, compatibleWith: nil)
@available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
static let gradientRight = UIColor(named: "GradientRight", in: bundle, compatibleWith: nil)
@available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
static let homeGradientLeft = UIColor(named: "HomeGradientLeft", in: bundle, compatibleWith: nil)
@available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
static let homeGradientRight = UIColor(named: "HomeGradientRight", in: bundle, compatibleWith: nil)
🧰 Tools
🪛 SwiftLint (0.57.0)

[Warning] 49-49: TODOs should be resolved (제거될 색상들)

(todo)

🤖 Prompt for AI Agents
In Projects/Presentation/Sources/Common/DesignSystem/BitnagilColor.swift around
lines 49 to 55, the color constants marked for removal should be annotated with
@available(*, deprecated, message: "Use new color constants instead") to
suppress SwiftLint TODO warnings and enable deprecation warnings during usage.
Add this annotation above each deprecated color constant declaration. After
this, check the usage locations in GradientProgressView.swift lines 26-27 and
HomeView.swift lines 394-395 to replace deprecated colors with new ones while
monitoring deprecation warnings.

// MARK: - Navy Colors
static let navy50 = UIColor(named: "Navy50", in: bundle, compatibleWith: nil)
static let navy100 = UIColor(named: "Navy100", in: bundle, compatibleWith: nil)
Expand All @@ -70,16 +77,4 @@ enum BitnagilColor {
static let lightBlue700 = UIColor(named: "LightBlue700", in: bundle, compatibleWith: nil)
static let lightBlue800 = UIColor(named: "LightBlue800", in: bundle, compatibleWith: nil)
static let lightBlue900 = UIColor(named: "LightBlue900", in: bundle, compatibleWith: nil)

// MARK: - Orange Colors
static let orange50 = UIColor(named: "Orange50", in: bundle, compatibleWith: nil)
static let orange100 = UIColor(named: "Orange100", in: bundle, compatibleWith: nil)
static let orange200 = UIColor(named: "Orange200", in: bundle, compatibleWith: nil)
static let orange300 = UIColor(named: "Orange300", in: bundle, compatibleWith: nil)
static let orange400 = UIColor(named: "Orange400", in: bundle, compatibleWith: nil)
static let orange500 = UIColor(named: "Orange500", in: bundle, compatibleWith: nil)
static let orange600 = UIColor(named: "Orange600", in: bundle, compatibleWith: nil)
static let orange700 = UIColor(named: "Orange700", in: bundle, compatibleWith: nil)
static let orange800 = UIColor(named: "Orange800", in: bundle, compatibleWith: nil)
static let orange900 = UIColor(named: "Orange900", in: bundle, compatibleWith: nil)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,42 @@
import UIKit

struct BitnagilFont {
let family: FontFamily
let style: FontStyle
let weight: FontWeight

init(style: FontStyle, weight: FontWeight) {
init(
family: FontFamily = .pretendard,
style: FontStyle,
weight: FontWeight
) {
self.family = family
self.style = style
self.weight = weight
}

init(fontSize: CGFloat,
lineHeight: CGFloat,
letterSpacing: CGFloat = 0,
underline: Bool = false,
weight: FontWeight
init(
family: FontFamily = .pretendard,
fontSize: CGFloat,
lineHeight: CGFloat,
letterSpacing: CGFloat = 0,
underline: Bool = false,
weight: FontWeight
) {
let attributes = FontAttributes(
fontSize: fontSize,
lineHeight: lineHeight,
letterSpacing: letterSpacing,
underline: underline)
self.family = family
self.style = .custom(fontAttribute: attributes)
self.weight = weight
}

var font: UIFont {
guard let font = UIFont(name: weight.fontName, size: style.fontAttributes.fontSize) else {
return UIFont.systemFont(ofSize: style.fontAttributes.fontSize)
}
guard let font = UIFont(name: family.fontName(weight: weight), size: style.fontAttributes.fontSize)
else { return UIFont.systemFont(ofSize: style.fontAttributes.fontSize) }

Comment on lines 43 to +46

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

❓ Verification inconclusive

폰트 로드 실패 시 조용한 폴백을 피하기 위한 ASSERT 추가 권장

잘못된 PS 이름/미등록 시, 현재는 시스템 폰트로 조용히 대체됩니다. DEBUG에서만이라도 실패를 감지하면 빠르게 수정 가능합니다.

-guard let font = UIFont(name: family.fontName(weight: weight), size: style.fontAttributes.fontSize)
-else { return UIFont.systemFont(ofSize: style.fontAttributes.fontSize) }
+guard let font = UIFont(name: family.fontName(weight: weight), size: style.fontAttributes.fontSize) else {
+    #if DEBUG
+    assertionFailure("[Font] \(family).\(weight) 폰트 로드 실패. 시스템 폰트로 대체됩니다.")
+    #endif
+    return UIFont.systemFont(ofSize: style.fontAttributes.fontSize)
+}

DEBUG 모드에서 폰트 로드 실패 시 경고(assertion) 추가 권장

현재 PS 폰트 이름이 잘못되었거나 등록되지 않은 경우 시스템 폰트로 조용히 대체되므로, 디버그 환경에서 빠르게 문제를 인지할 수 있도록 assertionFailure를 추가해 주세요.

  • 대상 파일: Projects/Presentation/Sources/Common/DesignSystem/Font/BitnagilFont.swift
  • 대상 위치: 43–46줄
-   guard let font = UIFont(name: family.fontName(weight: weight), size: style.fontAttributes.fontSize)
-   else { return UIFont.systemFont(ofSize: style.fontAttributes.fontSize) }
+   guard let font = UIFont(name: family.fontName(weight: weight), size: style.fontAttributes.fontSize) else {
+       #if DEBUG
+       assertionFailure("[Font] \(family).\(weight) 폰트 로드 실패. 시스템 폰트로 대체됩니다.")
+       #endif
+       return UIFont.systemFont(ofSize: style.fontAttributes.fontSize)
+   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
var font: UIFont {
guard let font = UIFont(name: weight.fontName, size: style.fontAttributes.fontSize) else {
return UIFont.systemFont(ofSize: style.fontAttributes.fontSize)
}
guard let font = UIFont(name: family.fontName(weight: weight), size: style.fontAttributes.fontSize)
else { return UIFont.systemFont(ofSize: style.fontAttributes.fontSize) }
var font: UIFont {
guard let font = UIFont(
name: family.fontName(weight: weight),
size: style.fontAttributes.fontSize
) else {
#if DEBUG
assertionFailure("[Font] \(family).\(weight) 폰트 로드 실패. 시스템 폰트로 대체됩니다.")
#endif
return UIFont.systemFont(ofSize: style.fontAttributes.fontSize)
}
return font
}
🤖 Prompt for AI Agents
In Projects/Presentation/Sources/Common/DesignSystem/Font/BitnagilFont.swift
around lines 43 to 46, add an assertionFailure call inside the guard else block
that handles the font loading failure. This assertionFailure should trigger in
debug mode to warn developers when the custom font fails to load, while still
returning the system font as fallback. This will help quickly identify font
registration or naming issues during development.

return font
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// FontFamily.swift
// Presentation
//
// Created by 최정인 on 8/9/25.
//

enum FontFamily {
case pretendard
case cafe24Ssurround

func fontName(weight: FontWeight) -> String {
switch self {
case .pretendard:
return weight.pretendardFontName
case .cafe24Ssurround:
return weight.cafe24FontName
}
}
Comment on lines +12 to +19

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

패밀리별 지원 weight 검증(ASSERT) 추가 권장

cafe24Ssurround는 현재 .light만 유효하다면, 여기서도 방어 로직을 두면 오용을 빠르게 발견할 수 있습니다. (실행환경에서 시스템 폰트로 조용히 폴백되는 것을 방지)

가능한 수정 예:

 case .cafe24Ssurround:
-    return weight.cafe24FontName
+    if case .light = weight {
+        return weight.cafe24FontName
+    } else {
+        assertionFailure("[Font] Cafe24Ssurround는 현재 .light만 지원합니다. Pretendard-Regular로 폴백합니다.")
+        return FontFamily.pretendard.fontName(weight: .regular)
+    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func fontName(weight: FontWeight) -> String {
switch self {
case .pretendard:
return weight.pretendardFontName
case .cafe24Ssurround:
return weight.cafe24FontName
}
}
func fontName(weight: FontWeight) -> String {
switch self {
case .pretendard:
return weight.pretendardFontName
case .cafe24Ssurround:
if case .light = weight {
return weight.cafe24FontName
} else {
assertionFailure("[Font] Cafe24Ssurround는 현재 .light만 지원합니다. Pretendard-Regular로 폴백합니다.")
return FontFamily.pretendard.fontName(weight: .regular)
}
}
}
🤖 Prompt for AI Agents
In Projects/Presentation/Sources/Common/DesignSystem/Font/FontFamily.swift
around lines 12 to 19, add assertion checks in the fontName(weight:) method to
verify that the provided weight is supported by each font family. For example,
assert that only .light weight is used for cafe24Ssurround to prevent silent
fallback to system fonts. Implement these assertions inside each case before
returning the font name to catch misuse early during development.

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ enum FontStyle {
case button1
case button2

case cafe24Title1

case custom(fontAttribute: FontAttributes)

var fontAttributes: FontAttributes {
Expand All @@ -49,6 +51,8 @@ enum FontStyle {
case .button2: FontAttributes(fontSize: 14, lineHeight: 20)

case .custom(let fontAttribute): fontAttribute

case .cafe24Title1: FontAttributes(fontSize: 24, lineHeight: 36, letterSpacing: -0.5)
}
}
}
Loading
Loading