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

Incorrect word wrapping when breaking a word #5944

Open
4 tasks done
Nerixyz opened this issue Feb 9, 2025 · 0 comments
Open
4 tasks done

Incorrect word wrapping when breaking a word #5944

Nerixyz opened this issue Feb 9, 2025 · 0 comments
Labels
bug Something isn't working as intended, or works in a confusing/unintuitive way for the user

Comments

@Nerixyz
Copy link
Contributor

Nerixyz commented Feb 9, 2025

Checklist

  • I'm reporting a problem with Chatterino
  • I've verified that I'm running the most recent nightly build or stable release
  • I've looked for my problem on the wiki
  • I've searched the issues and pull requests for similar looking reports

Describe your issue

On some fonts, we don't do word wrapping correctly when a single word needs to be split. Consider the following example:

  • Set font to Arial
  • (use any font engine)
  • Generate a message with a lot of numbers, for example:
    /timeout 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
    
  • Resize the window to break the word
Incorrect (more) Correct
Image Image

We're using horizontalAdvance on every codepoint in the text. This doesn't always return the actual advancement in the word, because a character can have left/rightBearing.

My "(more) correct" version is from Nerixyz@1ead4bb where I used the private API to do the advancing. There might be a way of doing this through left/rightBearing.

Screenshots

No response

OS and Chatterino Version

Chatterino 2.5.2 DEBUG (commit 1ead4bb modified) built with Qt 6.9.0, MSVC 194234436 Running on Windows 11 Version 24H2, kernel: 10.0.26100

@Nerixyz Nerixyz added the issue-report An issue reported by a user. label Feb 9, 2025
@pajlada pajlada added bug Something isn't working as intended, or works in a confusing/unintuitive way for the user and removed issue-report An issue reported by a user. labels Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended, or works in a confusing/unintuitive way for the user
Projects
None yet
Development

No branches or pull requests

2 participants