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

Bitmap Font Scaling pushes editor off-screen #83853

Open
rakkarage opened this issue Oct 23, 2023 · 4 comments
Open

Bitmap Font Scaling pushes editor off-screen #83853

rakkarage opened this issue Oct 23, 2023 · 4 comments

Comments

@rakkarage
Copy link
Contributor

rakkarage commented Oct 23, 2023

Godot version

v4.2.beta2.official [f8818f8]

System information

Godot v4.2.beta2 - Ubuntu 23.10 23.10 - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 6600 (RADV NAVI23) () - 12th Gen Intel(R) Core(TM) i5-12400F (12 Threads)

Issue description

After enabling bitmap font scaling. Right side of editor is pushed off-screen. Could be related to how the font also seems different size? Fixed when disabled.

Steps to reproduce

bitmap font scale is disabled in this test project import settings to begin with

  • work
    • create a new scene with a label, or open control.tscn
    • uses SuperWhite.fnt (default font in project settings)
    • works fine, note size of font, normal, about the size of a default button or label, same size it was in 4.1

277365331-304125d4-2bb6-4fca-bdd6-c9ad9cab4f39

  • not work:
    • change font scale in SuperWhite.fnt import settings to fractional (default)
    • need to reload project to use new settings?
    • note size of font, it is now much bigger, about 3x the size of a default button or label
    • want to check size of font but right half of editor is pushed off screen

277365219-f56479f8-a1ba-4f00-8500-a04d286a5478

to fix the editor temporarily can quit delete .godot/imported reload and will work till reload again

to fix editor permanently can disable bitmap font scaling and reload

Minimal reproduction project

https://github.com/rakkarage/test-bitmap-font-scale

@bruvzg
Copy link
Member

bruvzg commented Oct 25, 2023

note size of font, it is now much bigger, about 3x the size of a default button or label

That's expected, your font defines itself as size 1 font (but actual glyph size seems to be 12), and default font size is 16 so in the Label it will be 16 times larger (instead of 1.3x).

I can't reproduce the editor UI issue.

@rakkarage
Copy link
Contributor Author

rakkarage commented Oct 25, 2023

https://www.angelcode.com/products/bmfont/doc/file_format.html
The "size" in the ".fnt" file "holds information on how the font was generated" and i was not expecting it to be used.

Maybe there is some way to draw the font as it is without using the point(?) size of the source ttf into account. just based on how many pixels the font has. like is done now when scaling disabled. idk

I can still reproduce it in beta2 with the size 1, but not if i change size to 12. (need to change SuperWhite.fnt import settings and reload after reimport) Maybe specific to ubuntu or wayland? idk

Or maybe i should just fix my size to match lineheight

Thanks.

@rakkarage
Copy link
Contributor Author

image

Even updated to size 12... preview of integer or fraction scaled font is not pixel perfect like disabled, i feel like size should be ignored and disabled size should be used instead maybe but idk? i guess it is calculated using both sizes? the size from fnt and the size from godot? The pixel font already has an actual pixel size? Idk. Thanks.

@rakkarage
Copy link
Contributor Author

rakkarage commented Nov 18, 2023

info

This tag holds information on how the font **was generated**.
face	This is the name of the true type font.
size	The size of the **true type font**.
bold	The font is bold.
italic	The font is italic.
charset	The name of the OEM charset used (when not unicode).
unicode	Set to 1 if it is the unicode charset.
stretchH	The font height stretch in percentage. 100% means no stretch.
smooth	Set to 1 if smoothing was turned on.
aa	The supersampling level used. 1 means no supersampling **was** used.
padding	The padding for each character (up, right, down, left).
spacing	The spacing for each character (horizontal, vertical).
outline	The outline thickness for the characters.

This property is not how you set or get the size of a fnt? the information is not needed, and it is the wrong information.
Even if you do use the size of the original ttf font to scale the png font: 1 should not push ui off screen?

Thanks.

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