-
Notifications
You must be signed in to change notification settings - Fork 12
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
Unnecessary spaces between nodes of different colors. #66
Comments
Ah, yes, this is a tricky one. Here's the width of three different strings:
As you can see you get a different width of the string "Georg," when you measure "Georg" and "," individually and sum the widths. I'm not entirely sure what can be done about it.... |
I understand that this is due to the possibility of overlaying font elements in the word. For example, we can to find blocks of the same font size, calculate their width as a seamless node and subtract the width difference between seamless node and two separated nodes. And then set this difference to the offset. Ideally, we should get the margins of the first/last node font symbols itself and combine the nodes with the overlay margins. |
@astrochili Did you ever come up with a solution that worked for you? |
Unfortunately, no, but if you know in advance which parts you need to highlight, you can highlight them with the default color in the normal state. This should allow you to change only the color without changing the nodes. But this method doesn't solve the problem of extra spacing. |
@JCash |
really stupid hacky way I'm considering: |
I haven't thought about it tbh. |
We're also dealing with this issue and are looking for a fix or workaround |
I'm trying to color a part of existing text, but the library creates unnecessary spaces between nodes of different colors.
Hello Mickey,
- >He llo Mickey ,
Georg,
->Georg ,
Adam?
->Adam ?
An example to reproduce: richtext_coloring.zip
The text was updated successfully, but these errors were encountered: