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

Font is rendered pixelated in editor due to font oversampling not being effective when zooming #33968

Closed
letsgamedev opened this issue Nov 28, 2019 · 8 comments

Comments

@letsgamedev
Copy link

Godot version:
3.2.beta2 and all before that :)

OS/device including version:
Windows and MacOS

Issue description:
Texts in the editor are rendered super pixelated but in-game normal.
I am making a game with a resolution of 320*90.
So I think, the font is rendered good if the zoom is set to 100% but is not rerendered if I zoom closer in. This makes the positioning of elements very time-consuming.

Steps to reproduce:
Add a Label and zoom in.

The upper image is from editor, the lower from in-game.

rect837

@Calinou
Copy link
Member

Calinou commented Nov 28, 2019

The DynamicFont oversampling factor is global, which means it can't be set on a per-font basis. We'd need this to be able to oversample the font when zooming in and out.

As a workaround, you can increase your project's base resolution. If you need to run it at a lower resolution for testing purposes, you can change Test Width and Test Height in the Project Settings.

@girng

This comment has been minimized.

@akien-mga
Copy link
Member

@girng Please only comment if you have something constructive to say.

@pwnorbitals
Copy link

The DynamicFont oversampling factor is global, which means it can't be set on a per-font basis.

Is this still the case today ?

We'd need this to be able to oversample the font when zooming in and out.

Is this implemented / implementable ? I wouldn’t really know where to start

@Calinou
Copy link
Member

Calinou commented Oct 1, 2020

Is this still the case today ?

Yes.

Is this implemented / implementable ? I wouldn’t really know where to start

This will require per-font oversampling factors to be implementable. Unfortunately, this is probably not trivial to add. Not to mention that re-rasterizing the font every time you zoom may negatively affect performance, especially at higher zoom levels.

Edit: With the upcoming addition of MSDF fonts, this issue may be solved as distance field fonts can be rendered at any scale without loss of quality: #44772

@bruvzg
Copy link
Member

bruvzg commented Mar 2, 2021

With the upcoming addition of MSDF fonts, this issue may be solved as distance field fonts can be rendered at any scale without loss of quality

And, as a side effect of MSDF implementation, oversampling can be overridden on the font basis as well.

@Calinou
Copy link
Member

Calinou commented Apr 11, 2021

Note that this could argued to be done by design, since you generally want your text to always be readable at the base resolution. The fact that the font looks pixelated/blurry when zooming in could serve as an "alert" that your text won't be readable at the base resoluton.

If you want text to look crisper in the editor, it means you should probably be working with a higher base resolution. When working with a 320×90 base resolution, you should really be using a pixel art font if you want text to be readable at that resolution 🙂

Either way, MSDF fonts will incidentally make fonts crisp regarldess of zoom or Control scaling in 4.0.

@Calinou Calinou changed the title font is redered pixalated in editor Font is rendered pixalated in editor due to font oversampling not being effective when zooming Apr 24, 2021
@Calinou
Copy link
Member

Calinou commented Aug 30, 2021

MSDF fonts were implemented in #51908, closing.

@Calinou Calinou closed this as completed Aug 30, 2021
@Calinou Calinou added this to the 4.0 milestone Aug 30, 2021
@Calinou Calinou changed the title Font is rendered pixalated in editor due to font oversampling not being effective when zooming Font is rendered pixelated in editor due to font oversampling not being effective when zooming Nov 13, 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

7 participants