-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Text gets blurry when resizing the viewport with the canvas_items
stretch mode
#86563
Comments
For reference, I was able to confirm this on my end. It seems to be related to how font oversampling works, possibly rounding in an incorrect manner. Changing font hinting settings in the import dock doesn't resolve the issue. cc @bruvzg |
@Calinou, maybe its related to both, I realized that the entire UI gets blurry too, is it supposed to happen? Just try with my MRP, just by changing the resolution the UI is all blurry |
Ok after some research I found a topic in godot forum with the same problem I had: https://forum.godotengine.org/t/blury-text-on-label/42452/2 After changing this settings I was able to get my game running crystal clear, not blurry interface and text
|
The issue you're encountering is different from the issue reported here. When zooming in the 2D editor, fonts are not re-rasterized as this could be extremely slow at high zoom levels. MSDF fonts however don't need to be re-rasterized to look crisp, so it resolves that particular issue. However, MSDF fonts don't address the problem outlined here for non-MSDF fonts (they are supposed to be perfectly crisp at 100% scaling).
Note that when you enable MSDF font rendering, font hinting and LCD subpixel layout settings are ignored, so you don't need to change these. |
I understand, Im using the default fonts from godot 4.2 so It's definitely other problem. Should I open a new issue then? Also I just want to add to the topic that the blurry was not in the editor it was in the game itself and after changing this settings the GAME become crystal clear. If this is the way it's supposed to be I believe this option should be enabled by default or stated in the docs more clearly. |
This was already talked about a while ago, and was considered to not be a bug as we can't resolve it without excessive performance overhead: #69711 On top of that, it could be argued that re-rasterizing DynamicFonts when you zoom in the editor would be misleading as this behavior wouldn't occur when running the project and zooming with a Camera2D.
MSDF fonts can improve font appearance in the running project if you change Camera2D zoom. This is expected behavior, since it's how MSDF fonts work: they are rasterized once, and a shader is used to interpolate smooth curves from the signed distance field data.
MSDF fonts have several limitations outlined in the documentation and don't look great at small sizes, so we can't make them the default. |
I have an issue with only tooltips becoming blurry. All other text and custom tooltips that we have implemented in Thrive (but made to look basically like the inbuilt ones) look fine when scaled and even their borders are non-blurry. So only inbuilt tooltips experience blurriness problems in text and their borders also look pixelated so it is not only the text that is impacted. Should I open a separate issue about that? I couldn't find any issues specifically about blurry tooltips. |
This is already being tracked in #54030. |
Thanks. I did see that issue before but there was so much discussion that I couldn't see that it would also be relevant for tooltips. |
This comment has been minimized.
This comment has been minimized.
Having the same issue when changing Window>Stretch>Scale in Project Settings with the I have text with font size of 16px. When changing the stretch scale to 1.25x, the font would be 20px, but it looks blurry even though the font size is being scaled to an integer. |
canvas_items
stretch mode
Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.
Tested versions
System information
Godot v4.2.1.stable - Windows 10.0.19045 - GLES3 (Compatibility) - NVIDIA GeForce GTX 950M (NVIDIA; 31.0.15.3118) - Intel(R) Core(TM) i5-6300HQ CPU @ 2.30GHz (4 Threads)
Issue description
One of the main advantages of the
canvas_items
stretch mode (née2d
) is that it scales the UI automatically while keeping the shapes and fonts crisp at any window size. It's particularly useful when you want to keep the same size ratios in your UI regardless of resolution. This is illustrated by the attached project, which I've created for both Godot 3 and Godot 4.Here are two screenshots taken on Godot 3 (view them at 100% size to get a better idea):
The text remains crisp in Godot 3 when the viewport size increases or decreases.
However, in Godot 4, the behavior is different and fonts get slightly blurry at any resolution other than the viewport size defined in the settings.
The same behavior can be observed when resizing to a smaller viewport size, with blur being particularly noticeable.
Steps to reproduce
Minimal reproduction project (MRP)
The text was updated successfully, but these errors were encountered: