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

Control with custom dynamic font has a y size of infinity after Win + D (due to DynamicFont oversampling) #54590

Closed
VoNguyenMinhTriet opened this issue Nov 4, 2021 · 7 comments
Milestone

Comments

@VoNguyenMinhTriet
Copy link

VoNguyenMinhTriet commented Nov 4, 2021

Godot version

3.3.4.stable

System information

Windows 10

Issue description

On a project with 2D stretch mode, using show desktop (Windows + D) and then go back makes controls containing text with a dynamic font stretch their y size to infinity.
Before:
image
After Win + D and restoring:
image
Inside the inspector (at rect_size):
image

I specifically said Windows + D instead of minimizing and restoring, and this only happens on 2D stretch mode.

Steps to reproduce

Import a custom font like Arial to a project. Create a scene with Control root node and a Label inside. Use a custom DynamicFont for that Label with Arial as the font data. Change project stretch mode to 2D. Run that scene and press Windows + D 2 times.

Minimal reproduction project

(Deleted due to containing Arial font)

@VoNguyenMinhTriet
Copy link
Author

VoNguyenMinhTriet commented Nov 4, 2021

Shoot, there is a workaround, disabling font oversampling.

@akien-mga
Copy link
Member

Well, that's still a bug for when font oversampling is enabled, no?

@VoNguyenMinhTriet
Copy link
Author

It still is for 3.3.4.stable.

@Calinou Calinou changed the title Control with custom dynamic font has a y size of infinity after Win + D Control with custom dynamic font has a y size of infinity after Win + D (due to DynamicFont oversampling) Nov 4, 2021
@Calinou
Copy link
Member

Calinou commented Nov 4, 2021

Can you try reproducing this in 3.4rc3? It may have been fixed by #51973. If that doesn't fix it, I guess we could clamp the minimum font oversampling size or factor to a value like 4 pixels or 10% of the original scale.

It's also worth checking whether this happens on master on a new project with a nightly build.

Import a custom font like Arial to a project. Create a scene with Control root node and a Label inside. Use a custom DynamicFont for that Label with Arial as the font data. Change project stretch mode to 2D. Run that scene and press Windows + D 2 times.

This is unrelated to the issue itself, but remember that Microsoft fonts' licenses don't allow you to redistribute the font files. Consider using open source metrics-compatible fonts instead, such as Arimo.

@VoNguyenMinhTriet
Copy link
Author

This is unrelated to the issue itself, but remember that Microsoft fonts' licenses don't allow you to redistribute the font files. Consider using open source metrics-compatible fonts instead, such as Arimo.

Thanks for reminding me! For one second I thought Arial was free to use.

@VoNguyenMinhTriet
Copy link
Author

I can now confirm this issue is not reproducible in 3.4rc3.

@Calinou
Copy link
Member

Calinou commented Nov 4, 2021

Thanks for testing 🙂 Closing as resolved then.

@Calinou Calinou closed this as completed Nov 4, 2021
@Calinou Calinou added this to the 3.4 milestone Nov 4, 2021
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

3 participants