messageFeed branch: message body with CJK characters is truncated in height #59
Labels
No labels
Bug
Documentation
Easy
Feature
Localization
Packaging
Refactoring
Test
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: blue/squawk#59
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm afraid
bodyMetrics.boundingRect()
doesn't do well in measuring the space of texts, if they contain CJK characters.The texts:
Oh... that's unfortunate... For now I don't know how to treat it...
I'll see what I can do
May I ask you to retest? I reworked that piece, may be the error went away?)
I think I know why it's happening and it's my fault: the default font for the system surely doesn't have those Japaneze and Chineze symbols, so, when I measure it probably imagines it like if it was going to render them as those quads, fillers... And when the message sizes are measured and everything is calculated the actual label of the text ends up being painted it has differet font and different size, that's why it gets clipped.
So.. I need to, somehow, get this situation, measure it in font and text agnostic way... I have no idea yet where do I even start with it
Let's see, I'll try to measure it myself keeping in mind a set of fonts...
I asked on here, may be someone will share his wisdom?
https://stackoverflow.com/questions/71894044/qt-font-agnostic-text-bounding-rect
It's bad, measuring text is one of the hardest tasks ever, there is hinting and kerning, responsible Qt code is huge... not sure I can find a flaw there...
I think I got it: had to rewrite the way I render message body. Also had to handle mouse events manually to make mouse selection work in this way of rendering.
Now those examples you sent, they look just fine!
Thank you again for reporting this issue
Awesome! Glad you found the TextBrowser workaround.
I'm so sorry it took me so long(