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 fonts] Add support for scaling. #80605

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Aug 14, 2023

Adds import option for the bitmap fonts to enable scaling support (integer or arbitrary).

Fixes #80497
Fixes godotengine/godot-proposals#6150

doc/classes/TextServer.xml Outdated Show resolved Hide resolved
doc/classes/TextServer.xml Outdated Show resolved Hide resolved
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Needs rebase.

@akien-mga akien-mga added the bug label Oct 13, 2023
@akien-mga
Copy link
Member

Looks good to me. Needs rebase.

Poke :)

modules/text_server_adv/text_server_adv.cpp Outdated Show resolved Hide resolved
modules/text_server_adv/text_server_adv.cpp Outdated Show resolved Hide resolved
modules/text_server_fb/text_server_fb.cpp Outdated Show resolved Hide resolved
modules/text_server_fb/text_server_fb.cpp Outdated Show resolved Hide resolved
modules/text_server_adv/text_server_adv.cpp Outdated Show resolved Hide resolved
modules/text_server_fb/text_server_fb.cpp Outdated Show resolved Hide resolved
@akien-mga akien-mga merged commit b1fe1f1 into godotengine:master Oct 13, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@sandord
Copy link

sandord commented Oct 22, 2023

Great work!

I don't think the default scaling configuration is correct though because my pixel art fonts all became very large. This is due to the default font size that is set in the theme (I think it is 16) and that setting used to be ignored.

@rakkarage
Copy link
Contributor

also seems to push the right side of editor off-screen after enabling? and reload project?
quit - delete .godot/imported (not .godot/editor) - reload fixes it
reload breaks it again...
quit - delete .godot/imported (not .godot/editor) - reload fixes it
reload breaks it again...
etc...

Screenshot from 2023-10-23 10-05-26

Screenshot from 2023-10-23 10-07-04

@Calinou
Copy link
Member

Calinou commented Oct 23, 2023

@sandord I suppose this means there's a small degree of compatibility breakage with this PR, but I think the new default behavior is what 99% of people expect when changing font size on a bitmap font (unless there is special casing that makes it ignore a non-overridden font size – I didn't test). So I'd prefer keeping the default to Enabled (Fractional).1

On the other hand, this approach is contrary to what this comment suggests. cc @bruvzg

@rakkarage Please open a separate issue with a minimal reproduction project attached.
Edit: Issue opened: #83853

Footnotes

  1. Remember that if you use integer scaling in the Viewport itself, you don't need to use Enabled (Integer) if you're careful about the font size setting – it's just a helper to ensure you don't accidentally use fractional font sizes for pixel art fonts.

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

Successfully merging this pull request may close these issues.

Can't set font size in themes for BMFont/Angelcode fonts (.fnt)
6 participants