Skip to content
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

BasicTextField: Chinese line height is inconsistent with English line height #1833

Closed
drakeet opened this issue Feb 12, 2022 · 2 comments
Closed

Comments

@drakeet
Copy link
Contributor

drakeet commented Feb 12, 2022

See screenshot, as the title says:
image

Obviously, the line height of English is smaller than that of Chinese, which will cause the line spacing to jump or flicker when inputting Chinese. Demo about this:

cl-vs-el.mp4

Related: JetBrains/compose-multiplatform-core#185 & #1781

Maybe we can test it like this:

@Test
fun `line heights`() {
  val paragraph = simpleParagraph(
    text = "中文\n\nEnglish",
    style = TextStyle(fontSize = 50.sp)
  )
  val firstLineHeight = paragraph.getLineHeight(0)

  for (i in 1 until paragraph.lineCount) {
    Truth.assertThat(paragraph.getLineHeight(i)).isEqualTo(firstLineHeight)
  }
}
@drakeet
Copy link
Contributor Author

drakeet commented Feb 12, 2022

Duplicate of #1832.

@drakeet drakeet closed this as completed Feb 12, 2022
@okushnikov
Copy link
Collaborator

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

@JetBrains JetBrains locked and limited conversation to collaborators Dec 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants