Skip to content

Conversation

@Naknakk
Copy link
Contributor

@Naknakk Naknakk commented Jun 9, 2024

⭐️Issue

close #151

🌟Motivation

  • 안녕하세요.. 바꾼 Line Height Multiple로 작업하다보니 한줄 짜리 라벨에도 위쪽에만 행간만큼 Inset이 생기는 등 몇가지 문제가 있더라구요..? 그래서 사람들은 도대체 어떻게 하나 하고 찾아봤습니다.

🌟Key Changes

  • 그 결과 피그마 상의 line Height(percentage)에 맞게 lineHeight를 잡고 거기에 baseLineOffset을 줘서 글씨를 가운데 정렬로 바꿔주는 형태로 하더라구요.. 이렇게 하니까 피그마 상의 글씨영역 inset까지 다 동일하게 잘 맞더라구요!!?
  • lineHeight를 고정 값으로 주는 거긴 하지만, 폰트가 바뀌는 일도 없기도 하고 피그마 상의 라벨과 동일하게 할 수 있는 최선의 방법이라 생각합니다.
  • 폰트 크기 값을 받아서 baseLineOffset을 고정으로 줘야 하는거라 lineHeightMultiple을 그대로 쓸 수 없어서, LineHeight로 변경했어요

🌟Simulation

이렇게 글씨가 예쁘게 중앙정렬 된 모습을 확인 할 수 있어요.

  • lineHeightMultiple만 하면 글씨가 Label 영역의 아래쪽에 붙어있게 되구요,
  • LineSpacing만 주는 경우는 두 줄 간의 간격만 설정하는 거라 한줄일 때 Label 영역이 피그마와 다르게 글씨에 딱 붙어서 잡히고, 위아래 여백이 없더라구요..

Screenshot 2024-06-09 at 19 05 36


🌟To Reviewer

  • 아주 간단한 변경사항입니다!!

@Naknakk Naknakk requested review from Guryss, ena-isme and hyowon612 and removed request for Guryss June 9, 2024 10:23
@Naknakk Naknakk self-assigned this Jun 9, 2024
Copy link
Member

@Guryss Guryss left a comment

Choose a reason for hiding this comment

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

확인했습니다. 꼼꼼한 나기 최고임 !!

Copy link
Member

@ena-isme ena-isme left a comment

Choose a reason for hiding this comment

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

단순히 툭 던진 테스크에도,, 꼼꼼하게 알아와주는 낙낙씨 ,,,
감사합니다 ,,, 🥹

PR 제목 마지막 점만 없애고 머지해주세영><

Comment on lines +272 to +277
self.attributedString.addAttribute(
.baselineOffset,
value: (lineHeight - self.label.font.lineHeight) / 2,
range: NSRange(location: 0, length: attributedString.length)
)

Copy link
Member

Choose a reason for hiding this comment

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

wow!

@Naknakk Naknakk changed the title [Chore] #151 - Line Height 피그마 상의 디자인과 동일하게 작동하도록 수정. [Chore] #151 - Line Height 피그마 상의 디자인과 동일하게 작동하도록 수정 Jun 11, 2024
@Naknakk Naknakk merged commit e2083ce into main Jun 11, 2024
@Naknakk Naknakk deleted the Chore/#151 branch June 11, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Chore] Font 변경&추가사항 반영, 컬러 에셋 추가

4 participants