feat: add optional improved text wrapping#6265
Merged
pajlada merged 10 commits intoChatterino:masterfrom Jul 20, 2025
Merged
Conversation
pajlada
requested changes
Jul 20, 2025
Member
pajlada
left a comment
There was a problem hiding this comment.
I'm fine with allowing users enabling this, but I don't want this enabled by default anywhere (even where we're comfortable with it).
If you change it to just the compile flag, I'd be OK merging this.
…t-at-the-cost-of-unholy-private-apis
pajlada
reviewed
Jul 20, 2025
Member
pajlada
left a comment
There was a problem hiding this comment.
Just this thing I'm unsure of what it does, otherwise looks good
pajlada
approved these changes
Jul 20, 2025
Nerixyz
added a commit
to Nerixyz/chatterino2
that referenced
this pull request
Jul 28, 2025
See the cmake flag `CHATTERINO_ALLOW_PRIVATE_QT_API` for details on how to test this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's a heartbreaking story, but improving the text wrapping while remaining fairly efficient requires private Qt APIs (#5944). Specifically, I ran into this because Twitch now allows Arabic display names. Those can get longer (e.g.
\uFDFD).horizontalAdvanceing on single characters there will yield incorrect widths. Thus, when the channel view is narrow enough for the username to require wrapping, the message text would appear in the wrong position ("Noto Sans" font).In the linked issue, I already experimented with using
QStackTextEngineto do the wrapping. Since it's a private API, I put it behind a configuration option. On Ubuntu we already build Qt, so we control the exact Qt version and can use private APIs.