diff --git a/core/ui/src/main/kotlin/com/afternote/core/ui/theme/AfternoteTypography.kt b/core/ui/src/main/kotlin/com/afternote/core/ui/theme/AfternoteTypography.kt index 8bf836579b..5c92211b8f 100644 --- a/core/ui/src/main/kotlin/com/afternote/core/ui/theme/AfternoteTypography.kt +++ b/core/ui/src/main/kotlin/com/afternote/core/ui/theme/AfternoteTypography.kt @@ -86,10 +86,13 @@ private val HeadingLineBreak = LineBreak.Heading * 가장 나쁘고(em 29 에서 0.50), Regular 은 바로 그 구간에서 1.00 이다. * * **Bold 를 쓸 수 있는 하한은 em 58px 이다** — 그래야 가로획이 6px 이 되어 1px 차이가 17% 로 - * 떨어진다. 기본 설정(밀도 480 · 글꼴 1.0)에서 약 19sp, 글꼴 배율을 0.8 로 줄인 기기에서는 - * 약 28sp 다. 이 파일의 스타일은 전부 그 아래라 Bold 를 쓸 자리가 없다. + * 떨어진다. 기본 설정(밀도 480 · 글꼴 1.0)에서 약 19sp, 위 표를 잰 기기(밀도 420 · 글꼴 배율 + * 0.8, sp→px 2.1)에서는 약 28sp 다. 본문 크기대는 어느 쪽에서도 그 아래지만 제목은 아니다. + * 기본 설정에서 `h1`(28sp) · `h2`(24sp) · `h3`(20sp) 가 하한 위고, 배율 0.8 기기에서도 `h1` 은 + * 58.8px 로 하한을 넘긴다. 그러니 이 하한이 닫는 것은 18sp 이하뿐이고, 제목이 Regular 인 근거는 + * 획 대비가 아니라 시안이다. * - * 시안도 `H2`·`H3`·`BodyLarge(B)`·`BodySmall(B)`·`CaptionLarge(B)`·`PrimaryButton` 을 전부 + * 시안은 `H2`·`H3`·`BodyLarge(B)`·`BodySmall(B)`·`CaptionLarge(B)`·`PrimaryButton` 을 전부 * Regular 페이스로 쓴다 — 정본 페이지 TEXT 노드 1,789건 전량이 `NanumBarunGothic` 이고 * `NanumBarunGothicBold` 는 0건이다. * @@ -155,7 +158,7 @@ data class AfternoteTypography( localeList = KoreanLocale, ), /** - * **[bodySmallR] 과 여섯 필드가 전부 같다 — 지금은 이름만 다른 같은 값이다.** 합치지 않고 + * **[bodySmallR] 과 모든 필드가 같다 — 지금은 이름만 다른 같은 값이다.** 합치지 않고 * 남기는 이유는 [captionLargeB] 와 같다. 상세는 그쪽 KDoc. */ val bodySmallB: TextStyle = @@ -196,7 +199,7 @@ data class AfternoteTypography( localeList = KoreanLocale, ), /** - * **[captionLargeR] 과 여섯 필드가 전부 같다 — 지금은 이름만 다른 같은 값이다.** + * **[captionLargeR] 과 모든 필드가 같다 — 지금은 이름만 다른 같은 값이다.** * ([bodySmallB]/[bodySmallR] 도 마찬가지다. [bodyLargeB]/[bodyLargeR] 는 줄높이가 달라 해당 없다.) * * **중복을 만든 것은 이 코드가 아니라 시안이다.** 정본 페이지에서도 `CaptionLarge(B)` 와 diff --git a/core/ui/src/test/kotlin/com/afternote/core/ui/theme/AfternoteTypographyPairTest.kt b/core/ui/src/test/kotlin/com/afternote/core/ui/theme/AfternoteTypographyPairTest.kt index e6c64faab0..dcf06297f1 100644 --- a/core/ui/src/test/kotlin/com/afternote/core/ui/theme/AfternoteTypographyPairTest.kt +++ b/core/ui/src/test/kotlin/com/afternote/core/ui/theme/AfternoteTypographyPairTest.kt @@ -24,25 +24,16 @@ import org.robolectric.annotation.Config class AfternoteTypographyPairTest { private val typography = AfternoteTypography() - /** 리뷰가 「같다」를 판정한 여섯 필드. 나머지 필드는 두 쌍 모두 기본값이다. */ - private fun TextStyle.comparedFields() = - listOf( - "fontFamily" to fontFamily, - "fontWeight" to fontWeight, - "fontSize" to fontSize, - "lineHeight" to lineHeight, - "lineBreak" to lineBreak, - "localeList" to localeList, - ) - + /** + * [TextStyle] 을 통째로 비교한다. 필드를 골라 비교하면 고르지 않은 필드로 두 자리가 갈려도 + * 잠금을 빠져나간다 — 한쪽에만 `letterSpacing` 을 넣어 실측했다(#2061). + */ private fun assertSameStyle( name: String, b: TextStyle, r: TextStyle, ) { - b.comparedFields().zip(r.comparedFields()).forEach { (bField, rField) -> - assertEquals("$name 의 ${bField.first} 가 갈렸다 — #1862 참조", rField.second, bField.second) - } + assertEquals("$name 의 B 와 R 이 갈렸다 — #1862 참조", r, b) } @Test