-
Notifications
You must be signed in to change notification settings - Fork 1
Typography System 설계 및 적용 #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c9d1de8
refactor: PrezelColors 파일 위치 변경
moondev03 c37a9e4
feat: Pretendard 폰트 파일 추가
moondev03 d6a82e4
feat: Prezel Design System 폰트 스펙 정의
moondev03 a12802b
feat: PrezelTextStyle 추가
moondev03 ada5c9b
feat: Suit 폰트 PrezelFontFamily 추가
moondev03 6911ad5
feat: PrezelTextStyle 정의
moondev03 4877d7e
feat: PrezelTypography 추가
moondev03 e4d763f
feat: PrezelTypographyScheme 추가
moondev03 b2cb5fe
feat: PrezelTheme에 Typography 추가
moondev03 72677b6
refactor: PrezelTextStyle 패키지 이동에 따른 import 경로 수정
moondev03 26e2003
feat: 사용자의 글꼴 크기 설정에 대응하여 lineHeight 동적 sp 변환
moondev03 a9df66a
feat: PrezelFontSpec 및 TextStyle 리팩토링
moondev03 4b8d32d
feat: 타이포그래피 미리보기 추가
moondev03 5a98f4a
feat: Suit 폰트 PrezelTextStyle에 적용
moondev03 d457c7a
refactor: Prezel 폰트 상수명 변경
moondev03 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...l/core/designsystem/theme/PrezelColors.kt → ...gnsystem/foundation/color/PrezelColors.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...src/main/java/com/team/prezel/core/designsystem/foundation/typography/PrezelFontFamily.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package com.team.prezel.core.designsystem.foundation.typography | ||
|
|
||
| import androidx.compose.ui.text.font.Font | ||
| import androidx.compose.ui.text.font.FontFamily | ||
| import com.team.prezel.core.designsystem.R | ||
|
|
||
| internal val SuitFamily = FontFamily( | ||
| Font(R.font.suit_medium, PrezelFontWeight.REGULAR.value), | ||
| Font(R.font.suit_semi_bold, PrezelFontWeight.MEDIUM.value), | ||
| Font(R.font.suit_bold, PrezelFontWeight.BOLD.value), | ||
| ) |
58 changes: 58 additions & 0 deletions
58
...m/src/main/java/com/team/prezel/core/designsystem/foundation/typography/PrezelFontSpec.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| package com.team.prezel.core.designsystem.foundation.typography | ||
|
|
||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.platform.LocalDensity | ||
| import androidx.compose.ui.text.font.FontWeight | ||
| import androidx.compose.ui.unit.Dp | ||
| import androidx.compose.ui.unit.TextUnit | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.compose.ui.unit.em | ||
|
|
||
| enum class PrezelFontWeight( | ||
| val value: FontWeight, | ||
| ) { | ||
| REGULAR(FontWeight.Medium), | ||
| MEDIUM(FontWeight.SemiBold), | ||
| BOLD(FontWeight.Bold), | ||
| } | ||
|
|
||
| enum class PrezelFontSize( | ||
| private val value: Dp, | ||
| ) { | ||
| V100(12.dp), | ||
| V200(14.dp), | ||
| V300(16.dp), | ||
| V400(20.dp), | ||
| V500(24.dp), | ||
| ; | ||
|
|
||
| val sp: TextUnit | ||
| @Composable | ||
| get() = with(LocalDensity.current) { value.toSp() } | ||
| } | ||
|
|
||
| enum class PrezelFontLineHeight( | ||
| val value: Dp, | ||
| ) { | ||
| V100(16.dp), | ||
| V150(18.dp), | ||
| V200(20.dp), | ||
| V300(24.dp), | ||
| V400(28.dp), | ||
| V500(32.dp), | ||
| ; | ||
|
|
||
| val sp: TextUnit | ||
| @Composable | ||
| get() = with(LocalDensity.current) { value.toSp() } | ||
| } | ||
|
|
||
| enum class PrezelFontLetterSpacing( | ||
| val value: TextUnit, | ||
| ) { | ||
| V100(0.012.em), | ||
| V200(0.008.em), | ||
| V300(0.006.em), | ||
| V400((-0.012).em), | ||
| V500((-0.018).em), | ||
| } | ||
21 changes: 21 additions & 0 deletions
21
.../src/main/java/com/team/prezel/core/designsystem/foundation/typography/PrezelTextStyle.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package com.team.prezel.core.designsystem.foundation.typography | ||
|
|
||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.text.TextStyle | ||
|
|
||
| data class PrezelTextStyle( | ||
| val fontWeight: PrezelFontWeight, | ||
| val fontSize: PrezelFontSize, | ||
| val lineHeight: PrezelFontLineHeight, | ||
| val letterSpacing: PrezelFontLetterSpacing, | ||
| ) { | ||
| @Composable | ||
| fun toTextStyle(): TextStyle = | ||
| TextStyle( | ||
| fontFamily = SuitFamily, | ||
| fontWeight = fontWeight.value, | ||
| fontSize = fontSize.sp, | ||
| lineHeight = lineHeight.sp, | ||
| letterSpacing = letterSpacing.value, | ||
| ) | ||
| } |
122 changes: 122 additions & 0 deletions
122
...src/main/java/com/team/prezel/core/designsystem/foundation/typography/PrezelTextStyles.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| package com.team.prezel.core.designsystem.foundation.typography | ||
|
|
||
| internal object PrezelTextStyles { | ||
| val Title1Medium: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.MEDIUM, | ||
| fontSize = PrezelFontSize.V500, | ||
| lineHeight = PrezelFontLineHeight.V500, | ||
| letterSpacing = PrezelFontLetterSpacing.V500, | ||
| ) | ||
|
|
||
| val Title1Bold: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.BOLD, | ||
| fontSize = PrezelFontSize.V500, | ||
| lineHeight = PrezelFontLineHeight.V500, | ||
| letterSpacing = PrezelFontLetterSpacing.V500, | ||
| ) | ||
|
|
||
| val Title2Medium: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.MEDIUM, | ||
| fontSize = PrezelFontSize.V400, | ||
| lineHeight = PrezelFontLineHeight.V400, | ||
| letterSpacing = PrezelFontLetterSpacing.V400, | ||
| ) | ||
|
|
||
| val Title2Bold: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.BOLD, | ||
| fontSize = PrezelFontSize.V400, | ||
| lineHeight = PrezelFontLineHeight.V400, | ||
| letterSpacing = PrezelFontLetterSpacing.V400, | ||
| ) | ||
|
|
||
| val Body1Regular: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.REGULAR, | ||
| fontSize = PrezelFontSize.V400, | ||
| lineHeight = PrezelFontLineHeight.V400, | ||
| letterSpacing = PrezelFontLetterSpacing.V300, | ||
| ) | ||
|
|
||
| val Body1Medium: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.MEDIUM, | ||
| fontSize = PrezelFontSize.V400, | ||
| lineHeight = PrezelFontLineHeight.V400, | ||
| letterSpacing = PrezelFontLetterSpacing.V300, | ||
| ) | ||
|
|
||
| val Body1Bold: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.BOLD, | ||
| fontSize = PrezelFontSize.V400, | ||
| lineHeight = PrezelFontLineHeight.V400, | ||
| letterSpacing = PrezelFontLetterSpacing.V300, | ||
| ) | ||
|
|
||
| val Body2Regular: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.REGULAR, | ||
| fontSize = PrezelFontSize.V300, | ||
| lineHeight = PrezelFontLineHeight.V300, | ||
| letterSpacing = PrezelFontLetterSpacing.V300, | ||
| ) | ||
|
|
||
| val Body2Medium: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.MEDIUM, | ||
| fontSize = PrezelFontSize.V300, | ||
| lineHeight = PrezelFontLineHeight.V300, | ||
| letterSpacing = PrezelFontLetterSpacing.V300, | ||
| ) | ||
|
|
||
| val Body2Bold: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.BOLD, | ||
| fontSize = PrezelFontSize.V300, | ||
| lineHeight = PrezelFontLineHeight.V300, | ||
| letterSpacing = PrezelFontLetterSpacing.V300, | ||
| ) | ||
|
|
||
| val Body3Regular: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.REGULAR, | ||
| fontSize = PrezelFontSize.V200, | ||
| lineHeight = PrezelFontLineHeight.V200, | ||
| letterSpacing = PrezelFontLetterSpacing.V200, | ||
| ) | ||
|
|
||
| val Body3Medium: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.MEDIUM, | ||
| fontSize = PrezelFontSize.V200, | ||
| lineHeight = PrezelFontLineHeight.V200, | ||
| letterSpacing = PrezelFontLetterSpacing.V200, | ||
| ) | ||
|
|
||
| val Body3Bold: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.BOLD, | ||
| fontSize = PrezelFontSize.V200, | ||
| lineHeight = PrezelFontLineHeight.V200, | ||
| letterSpacing = PrezelFontLetterSpacing.V200, | ||
| ) | ||
|
|
||
| val Caption1Regular: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.REGULAR, | ||
| fontSize = PrezelFontSize.V200, | ||
| lineHeight = PrezelFontLineHeight.V150, | ||
| letterSpacing = PrezelFontLetterSpacing.V200, | ||
| ) | ||
|
|
||
| val Caption1Medium: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.MEDIUM, | ||
| fontSize = PrezelFontSize.V200, | ||
| lineHeight = PrezelFontLineHeight.V150, | ||
| letterSpacing = PrezelFontLetterSpacing.V200, | ||
| ) | ||
|
|
||
| val Caption2Regular: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.REGULAR, | ||
| fontSize = PrezelFontSize.V100, | ||
| lineHeight = PrezelFontLineHeight.V100, | ||
| letterSpacing = PrezelFontLetterSpacing.V100, | ||
| ) | ||
|
|
||
| val Caption2Medium: PrezelTextStyle = PrezelTextStyle( | ||
| fontWeight = PrezelFontWeight.MEDIUM, | ||
| fontSize = PrezelFontSize.V100, | ||
| lineHeight = PrezelFontLineHeight.V100, | ||
| letterSpacing = PrezelFontLetterSpacing.V100, | ||
| ) | ||
| } |
31 changes: 31 additions & 0 deletions
31
...src/main/java/com/team/prezel/core/designsystem/foundation/typography/PrezelTypography.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package com.team.prezel.core.designsystem.foundation.typography | ||
|
|
||
| import androidx.compose.runtime.Immutable | ||
| import androidx.compose.ui.text.TextStyle | ||
|
|
||
| @Immutable | ||
| data class PrezelTypography( | ||
| // Title | ||
| // 페이지나 섹션의 주요 제목 등 핵심 정보를 강조하는 데 사용하는 스타일입니다. | ||
| val title1Medium: TextStyle, | ||
| val title1Bold: TextStyle, | ||
| val title2Medium: TextStyle, | ||
| val title2Bold: TextStyle, | ||
| // Body | ||
| // 일반 본문과 설명, 단일 문장 또는 단락 등의 주된 콘텐츠 전달에 사용하는 스타일입니다. | ||
| val body1Regular: TextStyle, | ||
| val body1Medium: TextStyle, | ||
| val body1Bold: TextStyle, | ||
| val body2Regular: TextStyle, | ||
| val body2Medium: TextStyle, | ||
| val body2Bold: TextStyle, | ||
| val body3Regular: TextStyle, | ||
| val body3Medium: TextStyle, | ||
| val body3Bold: TextStyle, | ||
| // Caption | ||
| // 부가 정보, 안내, 설명, 작성 시간 등 메인 콘텐츠를 보조하는 짧은 정보를 전달할 때 사용하는 스타일입니다. | ||
| val caption1Regular: TextStyle, | ||
| val caption1Medium: TextStyle, | ||
| val caption2Regular: TextStyle, | ||
| val caption2Medium: TextStyle, | ||
| ) |
34 changes: 0 additions & 34 deletions
34
...ystem/src/main/java/com/team/prezel/core/designsystem/foundation/typography/TypeTokens.kt
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.