Strange pixel font scaling, how do I fix it?

Godot Version

Godot 4.7.2

Question

My Pixel font scales weirdly between in editor and windowed view
In editor:


In game:

What can I change to fix this?

enforce integer only scaling i.e. factors of 1, 2, 3, but never 1.1, 1.5. you would see the same effect by zooming in/out a little bit in the editor

I looked around and I can’t find a way to force a scaling mode on a dynamic font. Do you know any way to do so?

There is a project setting “display/window/stretch/scale_mode” can be set to “integer” this will create black borders around the game if it cannot scale the window to a whole number. Also the stretch mode “display/window/stretch/mode” could be set to “disabled” if you do not want the UI to increase in size with the window