Skip to content
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

PopupMenu, MenuButton, OptionButton text becomes blurry on canvas_items stretch mode when screen is resized #70791

Closed
lesleyrs opened this issue Jan 1, 2023 · 9 comments

Comments

@lesleyrs
Copy link

lesleyrs commented Jan 1, 2023

Godot version

4.0 beta 10

System information

Windows 10

Issue description

On both GLES and Vulkan renderer the optionbutton options become blurry when screen is resized other than the default size.

Steps to reproduce

Load repro project, run scene and try the options.

Minimal reproduction project

low_res_options.zip

PS: happy new year!

@Calinou
Copy link
Member

Calinou commented Jan 1, 2023

Related to #69749.

This occurs because font oversampling isn't used when rendering the PopupMenu.

cc @bruvzg

@bruvzg
Copy link
Member

bruvzg commented Jan 3, 2023

This occurs because font oversampling isn't used when rendering the PopupMenu.

Oversampling is a global value and should be applied to all text, it this case it seems like it's something wrong with embedded window scale mode in general.

@bruvzg
Copy link
Member

bruvzg commented Jan 3, 2023

it this case it seems like it's something wrong with embedded window scale mode in general.

Parent window content scale seems to be completely ignored by embedded windows.

@2fd5
Copy link

2fd5 commented Jan 25, 2023

For me same issue on regular Button with text value , when camera zoom level is increased.
Only text that is on CanvasLayer is not affected as it is not affected by the zoom level.
Godot 4.0.beta15 on macOS 13

Below the "Add" button is the one with the issue.
Screenshot 2023-01-25 at 18 41 02

@Calinou
Copy link
Member

Calinou commented Jan 25, 2023

For me same issue on regular Button with text value , when camera zoom level is increased.

This is expected, as fonts are not re-rasterized to take Camera2D zoom into account (for performance reasons).

If you want text to remain crisp in this situation, you need to enable Multichannel Signed Distance Field on the font in the Import dock. For the default project font, you need to enable the Default Font Multichannel Signed Distance Field advanced project setting instead.

@clayjohn clayjohn modified the milestones: 4.0, 4.x Jan 26, 2023
@Calinou Calinou changed the title OptionButton text becomes blurry on canvas_items stretch mode when screen is resized PopupMenu, MenuButton, OptionButton text becomes blurry on canvas_items stretch mode when screen is resized Apr 25, 2023
@justdaft
Copy link

I am having a similar issue with a texture looking blurry when the scale is reduced inside popup window.
popup_test.zip

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2023
@Calinou Calinou removed this from the 4.x milestone May 22, 2023
@2fd5
Copy link

2fd5 commented Jun 27, 2023

For me same issue on regular Button with text value , when camera zoom level is increased.

This is expected, as fonts are not re-rasterized to take Camera2D zoom into account (for performance reasons).

If you want text to remain crisp in this situation, you need to enable Multichannel Signed Distance Field on the font in the Import dock. For the default project font, you need to enable the Default Font Multichannel Signed Distance Field advanced project setting instead.

Thanks !
Using Default Font Multichannel Signed Distance Field made most of the fonts at zoom level 1.0 look weird and choppy:
image

This is with Default Font Multichannel Signed Distance Field off:
image

Not sure if that's technical limitation or shall I raise separate issue for that ?

The examples above are displayed on canvas item. Having said that Multichannel Signed Distance Field made fonts on the game map look better.

My workaround was to to keep the zoom operate in range of 1.0 and lower for zooming out. Effectively making it so that maximal zoom in game is 1.0, everything is crisp and readable, and can go lower for zooming out and seeing more of the map.

@Calinou
Copy link
Member

Calinou commented Jun 28, 2023

Using Default Font Multichannel Signed Distance Field made most of the fonts at zoom level 1.0 look weird and choppy:

Self-intersecting outlines are not supported by MSDF font rendering. This is a design limitation that could be fixed by integrating Skia, but this is a huge dependency given the size of the problem at hand.

To fix the issue, use a custom font with a proper bold variant instead of relying on automatically generated bold (embolden). Make sure to grab the font directly from the font maker's website, rather than Google Fonts as Google Fonts builds tend to contain self-intersecting outlines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants