diff --git a/HappyAnding/HappyAnding.xcodeproj/project.pbxproj b/HappyAnding/HappyAnding.xcodeproj/project.pbxproj index 206637ab..785c44b0 100644 --- a/HappyAnding/HappyAnding.xcodeproj/project.pbxproj +++ b/HappyAnding/HappyAnding.xcodeproj/project.pbxproj @@ -94,6 +94,14 @@ A323D3CA2AEE870700DDA716 /* SuggestionForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = A323D3C92AEE870700DDA716 /* SuggestionForm.swift */; }; A323D3CC2AEEA10F00DDA716 /* SuggestionFormViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A323D3CB2AEEA10F00DDA716 /* SuggestionFormViewModel.swift */; }; A323D3D02AEEE4B400DDA716 /* HapticManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A39504862AD46B9B0019895E /* HapticManager.swift */; }; + A329F7382BD0F32000ED20DA /* Pretendard-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = A329F7312BCA4FDE00ED20DA /* Pretendard-Bold.otf */; }; + A329F7392BD0F32100ED20DA /* Pretendard-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = A329F7312BCA4FDE00ED20DA /* Pretendard-Bold.otf */; }; + A329F73A2BD0F32300ED20DA /* Pretendard-SemiBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = A329F7332BCA4FDE00ED20DA /* Pretendard-SemiBold.otf */; }; + A329F73B2BD0F32400ED20DA /* Pretendard-SemiBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = A329F7332BCA4FDE00ED20DA /* Pretendard-SemiBold.otf */; }; + A329F73C2BD0F32600ED20DA /* Pretendard-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = A329F72E2BCA4FDE00ED20DA /* Pretendard-Medium.otf */; }; + A329F73D2BD0F32700ED20DA /* Pretendard-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = A329F72E2BCA4FDE00ED20DA /* Pretendard-Medium.otf */; }; + A329F73E2BD0F32900ED20DA /* Pretendard-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = A329F72F2BCA4FDE00ED20DA /* Pretendard-Regular.otf */; }; + A329F73F2BD0F32A00ED20DA /* Pretendard-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = A329F72F2BCA4FDE00ED20DA /* Pretendard-Regular.otf */; }; A33F74AE2908D8C800B8D0D0 /* CheckBoxShortcutCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A33F74AD2908D8C800B8D0D0 /* CheckBoxShortcutCell.swift */; }; A3439AF529395A100043E273 /* UserAuth.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87E606B729114FB200C3DA13 /* UserAuth.swift */; }; A3439AF629395A3A0043E273 /* CustomTextEditor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87276C372933F6AB00C92F4C /* CustomTextEditor.swift */; }; @@ -112,6 +120,9 @@ A3A6AD1E292763E2004C49DC /* ShareExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = A3A6AD14292763E2004C49DC /* ShareExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; A3C404D62A23D0E800C3BA75 /* AboutUpdateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C404D52A23D0E800C3BA75 /* AboutUpdateView.swift */; }; A3C5576C292BE084003907DC /* ShareExtensionWriteShortcutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C5576B292BE084003907DC /* ShareExtensionWriteShortcutView.swift */; }; + A3D348552BD1233000DE814C /* View+Font.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D348542BD1233000DE814C /* View+Font.swift */; }; + A3D348562BD1233A00DE814C /* View+Font.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D348542BD1233000DE814C /* View+Font.swift */; }; + A3D348572BD140CC00DE814C /* Image+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9AC2BB92935D34C00165820 /* Image+View.swift */; }; A3FC4747292A61550058BF26 /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = A3FC4746292A61550058BF26 /* FirebaseAnalytics */; }; A3FC4749292A61550058BF26 /* FirebaseAuth in Frameworks */ = {isa = PBXBuildFile; productRef = A3FC4748292A61550058BF26 /* FirebaseAuth */; }; A3FC474B292A61550058BF26 /* FirebaseDatabase in Frameworks */ = {isa = PBXBuildFile; productRef = A3FC474A292A61550058BF26 /* FirebaseDatabase */; }; @@ -290,6 +301,10 @@ A309862E2BBFE6B90004D993 /* View+Shadow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+Shadow.swift"; sourceTree = ""; }; A323D3C92AEE870700DDA716 /* SuggestionForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestionForm.swift; sourceTree = ""; }; A323D3CB2AEEA10F00DDA716 /* SuggestionFormViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestionFormViewModel.swift; sourceTree = ""; }; + A329F72E2BCA4FDE00ED20DA /* Pretendard-Medium.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Medium.otf"; sourceTree = ""; }; + A329F72F2BCA4FDE00ED20DA /* Pretendard-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Regular.otf"; sourceTree = ""; }; + A329F7312BCA4FDE00ED20DA /* Pretendard-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Bold.otf"; sourceTree = ""; }; + A329F7332BCA4FDE00ED20DA /* Pretendard-SemiBold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-SemiBold.otf"; sourceTree = ""; }; A33F74AD2908D8C800B8D0D0 /* CheckBoxShortcutCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckBoxShortcutCell.swift; sourceTree = ""; }; A3439AFA2939B0E80043E273 /* UserDefaults+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserDefaults+Extension.swift"; sourceTree = ""; }; A34BF82729AF3D55009BC946 /* AnnouncementCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnnouncementCell.swift; sourceTree = ""; }; @@ -307,6 +322,7 @@ A3A6AD232927BA06004C49DC /* ShareExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ShareExtension.entitlements; sourceTree = ""; }; A3C404D52A23D0E800C3BA75 /* AboutUpdateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutUpdateView.swift; sourceTree = ""; }; A3C5576B292BE084003907DC /* ShareExtensionWriteShortcutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareExtensionWriteShortcutView.swift; sourceTree = ""; }; + A3D348542BD1233000DE814C /* View+Font.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+Font.swift"; sourceTree = ""; }; A3FF0182291648A300384211 /* MailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MailView.swift; sourceTree = ""; }; A3FF01852918552E00384211 /* AboutTeamView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutTeamView.swift; sourceTree = ""; }; A3FF01872918581E00384211 /* LicenseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LicenseView.swift; sourceTree = ""; }; @@ -406,6 +422,7 @@ 8786B33D29ABA5A9000B46A1 /* View+Shape.swift */, A309862E2BBFE6B90004D993 /* View+Shadow.swift */, 8786B2E129A7F93B000B46A1 /* View+UIFont.swift */, + A3D348542BD1233000DE814C /* View+Font.swift */, ); path = View; sourceTree = ""; @@ -489,6 +506,7 @@ A0F822AA2910B8B900AF4448 /* ViewModel */, 4D7D16062986BBD7008B3332 /* TextLiteral.swift */, 87E99C7128F94EA8009B691F /* Assets.xcassets */, + A329F70F2BCA4F8F00ED20DA /* Resources */, 87E99C7328F94EA8009B691F /* Preview Content */, ); path = HappyAnding; @@ -699,6 +717,25 @@ path = ViewModel; sourceTree = ""; }; + A329F70F2BCA4F8F00ED20DA /* Resources */ = { + isa = PBXGroup; + children = ( + A329F7102BCA4FB200ED20DA /* Pretendard */, + ); + path = Resources; + sourceTree = ""; + }; + A329F7102BCA4FB200ED20DA /* Pretendard */ = { + isa = PBXGroup; + children = ( + A329F7312BCA4FDE00ED20DA /* Pretendard-Bold.otf */, + A329F7332BCA4FDE00ED20DA /* Pretendard-SemiBold.otf */, + A329F72E2BCA4FDE00ED20DA /* Pretendard-Medium.otf */, + A329F72F2BCA4FDE00ED20DA /* Pretendard-Regular.otf */, + ); + path = Pretendard; + sourceTree = ""; + }; A3439B01293A93960043E273 /* Recovered References */ = { isa = PBXGroup; children = ( @@ -918,10 +955,14 @@ files = ( 4D6A9F0129A3A92F00D02522 /* wrappinghstack+license.txt in Resources */, F90DEA5129327E62002140E2 /* Launch Screen.storyboard in Resources */, + A329F7382BD0F32000ED20DA /* Pretendard-Bold.otf in Resources */, + A329F73A2BD0F32300ED20DA /* Pretendard-SemiBold.otf in Resources */, F90DEA5029327E5D002140E2 /* Assets.xcassets in Resources */, F9BA11D329A389EA00176807 /* GoogleService-Info.plist in Resources */, 87E99C7528F94EA8009B691F /* Preview Assets.xcassets in Resources */, + A329F73E2BD0F32900ED20DA /* Pretendard-Regular.otf in Resources */, A3FF018A2918F8EF00384211 /* apache.txt in Resources */, + A329F73C2BD0F32600ED20DA /* Pretendard-Medium.otf in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -944,7 +985,11 @@ buildActionMask = 2147483647; files = ( A31F1848292A64D700AF4A82 /* Assets.xcassets in Resources */, + A329F73F2BD0F32A00ED20DA /* Pretendard-Regular.otf in Resources */, + A329F73D2BD0F32700ED20DA /* Pretendard-Medium.otf in Resources */, + A329F7392BD0F32100ED20DA /* Pretendard-Bold.otf in Resources */, F9BA11D429A389EA00176807 /* GoogleService-Info.plist in Resources */, + A329F73B2BD0F32400ED20DA /* Pretendard-SemiBold.otf in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1022,6 +1067,7 @@ 87E99C7028F94EA6009B691F /* ShortcutTabView.swift in Sources */, F99569182901DC4D0060AAEF /* UIFont+Extension.swift in Sources */, F91A72C32999160E00CA135A /* Alerter.swift in Sources */, + A3D348552BD1233000DE814C /* View+Font.swift in Sources */, 87E99CAD28FFF261009B691F /* ReadShortcutView.swift in Sources */, F930E0002BBD51EC003C2686 /* Seal.swift in Sources */, 4D5889E82AA36A52000C4849 /* AppDelegate.swift in Sources */, @@ -1103,6 +1149,7 @@ A3FC4756292A61B60058BF26 /* CategoryModalView.swift in Sources */, A3FC4758292A61C50058BF26 /* Shortcuts.swift in Sources */, 8786B2E729A7F9DF000B46A1 /* String+Date.swift in Sources */, + A3D348562BD1233A00DE814C /* View+Font.swift in Sources */, A3FC475A292A61CC0058BF26 /* Keyword.swift in Sources */, A3439AFC2939B0E80043E273 /* UserDefaults+Extension.swift in Sources */, F9DB8ED3293B4C3200516CE1 /* ShareExtensionTagTextField.swift in Sources */, @@ -1112,6 +1159,7 @@ F976E85129395B350088BBA1 /* ShareExtensionViewModel.swift in Sources */, A3FC4753292A61AE0058BF26 /* IconModalView.swift in Sources */, 4D7D16082986BBDE008B3332 /* TextLiteral.swift in Sources */, + A3D348572BD140CC00DE814C /* Image+View.swift in Sources */, A3FC474F292A616D0058BF26 /* UIFont+Extension.swift in Sources */, 8786B2ED29A7FAFA000B46A1 /* UIColor+Extension.swift in Sources */, A3FC475B292A61CE0058BF26 /* Category.swift in Sources */, diff --git a/HappyAnding/HappyAnding/Extensions/Image+View.swift b/HappyAnding/HappyAnding/Extensions/Image+View.swift index 5650b694..e4c050b6 100644 --- a/HappyAnding/HappyAnding/Extensions/Image+View.swift +++ b/HappyAnding/HappyAnding/Extensions/Image+View.swift @@ -9,6 +9,33 @@ import SwiftUI extension Image { + ///SF Symbol + func smallSF() -> some View { + resizable() + .scaledToFit() + .frame(width: 24, height: 24) + } + func mediumSF() -> some View { + resizable() + .scaledToFit() + .frame(width: 28, height: 28) + } + func largeSF() -> some View { + resizable() + .scaledToFit() + .frame(width: 36, height: 36) + } + func extraLargeSF() -> some View { + resizable() + .scaledToFit() + .frame(width: 46, height: 46) + } + func customSF(size: CGFloat) -> some View { + resizable() + .scaledToFit() + .frame(width: size, height: size) + } + /// Color가 gray4, size: 24, frame size가 32인 Cell을 관리하는 함수입니다. func setCellIcon() -> some View { self diff --git a/HappyAnding/HappyAnding/Extensions/View/View+Font.swift b/HappyAnding/HappyAnding/Extensions/View/View+Font.swift new file mode 100644 index 00000000..8c6da923 --- /dev/null +++ b/HappyAnding/HappyAnding/Extensions/View/View+Font.swift @@ -0,0 +1,67 @@ +// +// View+Font.swift +// HappyAnding +// +// Created by HanGyeongjun on 4/13/24. +// + +import SwiftUI + +///Pretendard 폰트를 관리하는 열거형 +///현재 regular, medium, semibold, bold 4가지 폰트가 .otf 확장자로 추가되어있음 +///파일의 위치는 Resources.Pretendard +///파일 추가를 위해서는 Info.plist의 Fonts provided by application추가 필요 +enum Pretendard: String { + case regular = "Pretendard-Regular" + case medium = "Pretendard-Medium" + case semiBold = "Pretendard-SemiBold" + case bold = "Pretendard-Bold" +} + +///Pretendard 폰트를 기존 modifier와 같이 사용할 수 있게 해 주는 Extension +///사용 예시 +///Text("단축어").largeTitle() +///Text("단축어").customPretendard(fontName: Pretendard.bold, size: 16) +extension View { + + func largeTitle() -> some View { + self.modifier(CustomFontStyle(fontName: Pretendard.bold.rawValue, size: 24)) + } + + func title1() -> some View { + self.modifier(CustomFontStyle(fontName: Pretendard.bold.rawValue, size: 20)) + } + + func subTitle1() -> some View { + self.modifier(CustomFontStyle(fontName: Pretendard.semiBold.rawValue, size: 16)) + } + + func subTitle2() -> some View { + self.modifier(CustomFontStyle(fontName: Pretendard.bold.rawValue, size: 15)) + } + + func body1() -> some View { + self.modifier(CustomFontStyle(fontName: Pretendard.medium.rawValue, size: 14)) + } + + func body2() -> some View { + self.modifier(CustomFontStyle(fontName: Pretendard.medium.rawValue, size: 12)) + } + + func subText1() -> some View { + self.modifier(CustomFontStyle(fontName: Pretendard.regular.rawValue, size: 10)) + } + + func customPretendard(fontName: Pretendard, size: CGFloat) -> some View { + self.modifier(CustomFontStyle(fontName: fontName.rawValue, size: size)) + } +} + +struct CustomFontStyle: ViewModifier { + var fontName: String + var size: CGFloat + + func body(content: Content) -> some View { + content.font(.custom(fontName, size: size)) + } +} diff --git a/HappyAnding/HappyAnding/Info.plist b/HappyAnding/HappyAnding/Info.plist index aa2b2c93..e9717ee2 100644 --- a/HappyAnding/HappyAnding/Info.plist +++ b/HappyAnding/HappyAnding/Info.plist @@ -30,5 +30,12 @@ URL Schemes shortcutsZip + UIAppFonts + + Pretendard-Bold.otf + Pretendard-SemiBold.otf + Pretendard-Medium.otf + Pretendard-Regular.otf + diff --git a/HappyAnding/HappyAnding/Resources/Pretendard/Pretendard-Bold.otf b/HappyAnding/HappyAnding/Resources/Pretendard/Pretendard-Bold.otf new file mode 100644 index 00000000..8e5e30a2 Binary files /dev/null and b/HappyAnding/HappyAnding/Resources/Pretendard/Pretendard-Bold.otf differ diff --git a/HappyAnding/HappyAnding/Resources/Pretendard/Pretendard-Medium.otf b/HappyAnding/HappyAnding/Resources/Pretendard/Pretendard-Medium.otf new file mode 100644 index 00000000..05750698 Binary files /dev/null and b/HappyAnding/HappyAnding/Resources/Pretendard/Pretendard-Medium.otf differ diff --git a/HappyAnding/HappyAnding/Resources/Pretendard/Pretendard-Regular.otf b/HappyAnding/HappyAnding/Resources/Pretendard/Pretendard-Regular.otf new file mode 100644 index 00000000..08bf4cfc Binary files /dev/null and b/HappyAnding/HappyAnding/Resources/Pretendard/Pretendard-Regular.otf differ diff --git a/HappyAnding/HappyAnding/Resources/Pretendard/Pretendard-SemiBold.otf b/HappyAnding/HappyAnding/Resources/Pretendard/Pretendard-SemiBold.otf new file mode 100644 index 00000000..e7e36abc Binary files /dev/null and b/HappyAnding/HappyAnding/Resources/Pretendard/Pretendard-SemiBold.otf differ diff --git a/HappyAnding/ShareExtension/Info.plist b/HappyAnding/ShareExtension/Info.plist index 1ca9910a..86d03a2c 100644 --- a/HappyAnding/ShareExtension/Info.plist +++ b/HappyAnding/ShareExtension/Info.plist @@ -17,5 +17,12 @@ NSExtensionPrincipalClass CustomShareNavigationController + UIAppFonts + + Pretendard-Bold.otf + Pretendard-SemiBold.otf + Pretendard-Medium.otf + Pretendard-Regular.otf +