Open jaberwok2010 opened 1 year ago
It looks like this issue disappears when you set a valid font then edit the text in any way:
An empty FontFile is not valid.
I have this issue regardless of whether a font resource is set within the FontFile or not. In fact, I became aware of this issue in part because I could not figure out why Labels/RichTextLabels from 3.X no longer worked as I expected after conversion to 4.0 -- and trying to replace them with new Labels/RichTextLabels resulted in the same unexpected behavior.
Has there been a change in what constitutes a valid font from 3.X to 4.0?
Edit: Evidently I had been loading .tres files produced in 3.X instead of the original font file. I am not sure why that did not work, but shifting to loading the original font file has corrected the issue. I am still unclear as to why an invalid FontFile would result in this particular manifestation, but in any case the issue I had appears to be corrected with this change. Thank you very much for your help.
Just adding a "me too" on this one. The spacing in between paragraphs was not appearing at a ll.
For me, the solution was to reset all of the font settings fields in rich text labels, and also inside my theme file. Now I have re-added the font settings, and line spacing now behaves as normal.
If the problem is that something is not loading properly, perhaps a better error message needs to logged out somewhere when something odd is picked up? I don't know if it is related to this problem, but I do see an error in my console about a bad file, but the error message provides no clue as to where to look to find out what might be the cause of the problem. Here is a screenshot to clarify:
Godot version
v4.0.3.stable.official [5222a99f5]
System information
Linux Mint 20.3 (una)
Issue description
Having a FontFile loaded into the Theme Overrides for a Label or RichTextLabel causes the node in question to condense repeated newlines tags down to a single newline. In other words, "\n\n\n\n" becomes "\n". This only occurs when a FontFile is loaded, and does not depend upon whether an actual font is loaded, present, or referenced. I would expect that loading a FontFile would not affect the way that Labels of any kind apply and render newlines.
Steps to reproduce
This is example text both follows and precedes three newlines.
This is example text both follows three newlines.