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 wrapping implementation does not match visual expectations #1833

Open
wang1212 opened this issue Nov 13, 2024 · 0 comments
Open

Text wrapping implementation does not match visual expectations #1833

wang1212 opened this issue Nov 13, 2024 · 0 comments

Comments

@wang1212
Copy link
Member

wang1212 commented Nov 13, 2024

In G, text line break detection is currently done by iteratively measuring the width of each character and then adding them up to determine whether a line break is needed. External users may configure wordWrapWidth by directly measuring the width of the entire text. The two different text measurement methods will lead to visual inconsistencies.

The reason is that when using canvas's TextMetrics to measure text, the total width of non-Chinese characters is greater when measured character by character than when measuring the entire text directly.

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

1 participant