-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
RichText Justified Behavior is Not Correct #92561
Comments
I suffer from this exact problem, the fill tag does not reproduce what is seem on word software justify, if it should, then its definitely not doing so, and if its a totally different meaning tag, then the richtextlabel is lacking an justify option. |
The current fill alignment is actually forced justification. To support standard justification, we would need to expose 3 additional alignment options:
The alignment determines the last line's alignment only, with other lines using fill. |
Ok so it's a confirmed bug. Thank you for looking into it. Would these alignment options be available in the next update? |
Default justification options include |
Might be also useful to add a configurable threshold to skip justification for any line that is too short. |
For RichTextLabel in particular, I wonder if the This would incur a small visual breakage in existing projects that use |
I believe on top of having the option skip_last, would be useful to have an option skip_intentional_breaks, as in, skip lines that breaks to a new line by the input string (the input contains \n or such), so if one have a string that contains multiple lines, the lines that don't fit on a single line and get auto wrapped would be justified, while the lines with actual line breaks would be ignored. |
This should be covered by |
Sorry, after some testing, indeed its covered, the issue I were having is if I use StringBuilder in C# to build an string with multiple lines, and it is running on windows, then Environment.NewLine is CRLF while on UNIX would be just LF, the issue I faced was that, godot actually treated both the CR and LF as one line each, so it were truly jumping 2 lines instead of 1, i changed it to force only the LF and it sorted this issue, but would be cool if there could be an option to handle that accordingly, or maybe godot should just skip/ignore CR. |
Tested versions
System information
Windows 11 - Godot v4.3.beta.mono.custom_build [afbb108e3]
Issue description
I've tried using the [fill] but it does not behave like the word justify, for example, on lines where theres little text and then a line break, it does extend them up until the box width, making it have super large empty spaces, instead of simply treating that as normal left align (i feel its lacking a thing like, if space width on line exceeds x value then treat this line as left align instead of [fill]).
Basically, what i would like is this:
but fill gives me this
It should detect the line break, and justify the text on the space from beginning up to where the line were broken, not up until to the end of the actual line past the line break.
Someone opened a similar issue but it didn't really fix the issue: #74359
@cal
Steps to reproduce
To reproduce this:
Minimal reproduction project (MRP)
richtextlabelfill.zip
The text was updated successfully, but these errors were encountered: