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

text/v2 draw.Text does not handle newlines correctly #3169

Closed
2 of 11 tasks
vzx opened this issue Dec 13, 2024 · 3 comments
Closed
2 of 11 tasks

text/v2 draw.Text does not handle newlines correctly #3169

vzx opened this issue Dec 13, 2024 · 3 comments

Comments

@vzx
Copy link

vzx commented Dec 13, 2024

Ebitengine Version

v2.8.5 and main

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • OpenBSD
  • Android
  • iOS
  • Nintendo Switch
  • PlayStation 5
  • Xbox
  • Web Browsers

Go Version (go version)

  • go version go1.23.4 linux/amd64
  • go version go1.23.4 darwin/arm64

What steps will reproduce the problem?

go run github.com/vzx/ebitengine-text-v2-newlines@main

What is the expected result?

On the right (v2), each line of text should appear on a separate line, just like on the left (v1).

What happens instead?

Lines of text are written on the same line, overwriting each other.

Anything else you feel useful to add?

No response

@hajimehoshi
Copy link
Owner

Specify LineSpacing.

https://pkg.go.dev/github.com/hajimehoshi/ebiten/[email protected]/text/v2#LayoutOptions

@hajimehoshi hajimehoshi closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 2024
@hajimehoshi hajimehoshi added wontfix and removed bug labels Dec 14, 2024
@vzx
Copy link
Author

vzx commented Dec 14, 2024

Thank you very much for responding so quickly.

Then I would like to suggest that this line of documentation on Draw be revised:

// The '\n' newline character puts the following text on the next line.

// The '\n' newline character puts the following text on the next line.

And/or perhaps an amendment of the example https://ebitengine.org/en/examples/font.html

Since I was unable to intuitively find this option.

@hajimehoshi
Copy link
Owner

Makes sense. Thank you for pointing this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants