diff --git a/SodaLive/Resources/Debug/SodaLive-dev-Info.plist b/SodaLive/Resources/Debug/SodaLive-dev-Info.plist index bd21034..528a4f7 100644 --- a/SodaLive/Resources/Debug/SodaLive-dev-Info.plist +++ b/SodaLive/Resources/Debug/SodaLive-dev-Info.plist @@ -251,6 +251,10 @@ Pretendard-Medium.otf Pretendard-Light.otf Pretendard-Regular.otf + NotoSansJP-Bold.ttf + NotoSansJP-Medium.ttf + NotoSansJP-Light.ttf + NotoSansJP-Regular.ttf UIBackgroundModes diff --git a/SodaLive/Resources/Font/NotoSansJP-Bold.ttf b/SodaLive/Resources/Font/NotoSansJP-Bold.ttf new file mode 100755 index 0000000..26a47bb Binary files /dev/null and b/SodaLive/Resources/Font/NotoSansJP-Bold.ttf differ diff --git a/SodaLive/Resources/Font/NotoSansJP-Light.ttf b/SodaLive/Resources/Font/NotoSansJP-Light.ttf new file mode 100755 index 0000000..7e8c292 Binary files /dev/null and b/SodaLive/Resources/Font/NotoSansJP-Light.ttf differ diff --git a/SodaLive/Resources/Font/NotoSansJP-Medium.ttf b/SodaLive/Resources/Font/NotoSansJP-Medium.ttf new file mode 100755 index 0000000..f107339 Binary files /dev/null and b/SodaLive/Resources/Font/NotoSansJP-Medium.ttf differ diff --git a/SodaLive/Resources/Font/NotoSansJP-Regular.ttf b/SodaLive/Resources/Font/NotoSansJP-Regular.ttf new file mode 100755 index 0000000..d13df30 Binary files /dev/null and b/SodaLive/Resources/Font/NotoSansJP-Regular.ttf differ diff --git a/SodaLive/Resources/Info.plist b/SodaLive/Resources/Info.plist index 60104c3..36db44e 100644 --- a/SodaLive/Resources/Info.plist +++ b/SodaLive/Resources/Info.plist @@ -251,6 +251,10 @@ Pretendard-Medium.otf Pretendard-Light.otf Pretendard-Regular.otf + NotoSansJP-Bold.ttf + NotoSansJP-Medium.ttf + NotoSansJP-Light.ttf + NotoSansJP-Regular.ttf UIBackgroundModes diff --git a/SodaLive/Sources/Extensions/KoreanFontModifier.swift b/SodaLive/Sources/Extensions/KoreanFontModifier.swift index 724bddf..1362543 100644 --- a/SodaLive/Sources/Extensions/KoreanFontModifier.swift +++ b/SodaLive/Sources/Extensions/KoreanFontModifier.swift @@ -16,7 +16,7 @@ private func resolvedLanguageCode(currentLocale: Locale) -> String? { return currentLocale.language.languageCode?.identifier } -private func appFontName(for weight: SwiftUI.Font.Weight) -> String { +private func koreanFontName(for weight: SwiftUI.Font.Weight) -> String { switch weight { case .bold: return "Pretendard-Bold" @@ -29,15 +29,33 @@ private func appFontName(for weight: SwiftUI.Font.Weight) -> String { } } +private func japaneseFontName(for weight: SwiftUI.Font.Weight) -> String { + switch weight { + case .bold: + return "NotoSansJP-Bold" + case .medium: + return "NotoSansJP-Medium" + case .light: + return "NotoSansJP-Light" + default: + return "NotoSansJP-Regular" + } +} + struct KoreanFontModifier: ViewModifier { @Environment(\.locale) private var locale let size: CGFloat let weight: SwiftUI.Font.Weight func body(content: Content) -> some View { - if resolvedLanguageCode(currentLocale: locale) == "ko" { - content.font(.custom(appFontName(for: weight), size: size)) - } else { + switch resolvedLanguageCode(currentLocale: locale) { + case "ko": + content.font(.custom(koreanFontName(for: weight), size: size)) + + case "ja": + content.font(.custom(japaneseFontName(for: weight), size: size)) + + default: content.font(.system(size: size, weight: weight)) } } @@ -52,8 +70,13 @@ extension View { extension Text { func appFont(size: CGFloat, weight: SwiftUI.Font.Weight = .regular) -> Text { if resolvedLanguageCode(currentLocale: .autoupdatingCurrent) == "ko" { - return self.font(.custom(appFontName(for: weight), size: size)) + return self.font(.custom(koreanFontName(for: weight), size: size)) } + + if resolvedLanguageCode(currentLocale: .autoupdatingCurrent) == "ja" { + return self.font(.custom(japaneseFontName(for: weight), size: size)) + } + return self.font(.system(size: size, weight: weight)) } }