You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue description:
With stretch_mode=2d and test_width/height set, get_wordwrap_string_size thinks my line of text has 2 lines when it actually has 3 when rendered.
Steps to reproduce:
Made a new project
Set width=1280, height=1280, test_width=800, test_height=800, stretch/mode="2d"
Use the font I'm using (BalsamiqSans-Regular 28) and try to render the string I'm trying to render ("If there's anything scary out there, we'll handle it for sure!")
Get a height of 70, but expect something >= 105 (each line is 35 high)
Note it works fine if I turn off either stretch_mode=2d or set test_width and test_height back to 0.
This may be caused by DynamicFont oversampling. As a workaround, you can disable it in the project settings but this will make the font pixelated (or blurry if Filter is enabled on the font).
You could also try disabling hinting in the DynamicFontData resource (remember to save it to a .tres file afterwards) and see if that improves things. Due to how it works, hinting will likely cause font metrics to change when the window is resized and DynamicFont oversampling is enabled.
It looks like this doesn't necessarily have anything to do with the stretch mode or even dynamicfonts at all. It happens in a default-settings project with the built-in font, which is not a dynamicfont. It also happens both with normal Labels and RichTextLabels. (The oversampling text flow bug will still cause this, but this happens for reason other than just the oversampling text flow bug.)
This should probably get looked at more closely. It makes get_wordwrap_string_size basically unusable for anything but diagnostics.
Notice that the panel does not resize itself to fit the label exactly when it's close to a line count boundary. It takes several pixels difference in width to actually wrap (so it's not a simple rounding issue that might go away with a judicious ceil() or float()).
Godot version:
3.3.0
OS/device including version:
MacOS 10.15.5
Issue description:
With stretch_mode=2d and test_width/height set, get_wordwrap_string_size thinks my line of text has 2 lines when it actually has 3 when rendered.
Steps to reproduce:
Note it works fine if I turn off either stretch_mode=2d or set test_width and test_height back to 0.
Minimal reproduction project:
Repro.zip
The text was updated successfully, but these errors were encountered: