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

Controls do not use default font from project's custom theme #36614

Closed
AaronWizard opened this issue Feb 27, 2020 · 13 comments
Closed

Controls do not use default font from project's custom theme #36614

AaronWizard opened this issue Feb 27, 2020 · 13 comments

Comments

@AaronWizard
Copy link

Godot version: 3.2.stable.official

OS/device including version: macOS Catalina 10.15.3

Issue description:

I created a custom theme for my project, that has a custom default font. Any GUI text in my scenes however still has Godot's default font, both in the editor and at runtime.

Steps to reproduce:

  1. Create and save a DynamicFont resource
  2. Create and save a Theme resource
  3. Set the theme's Default Font property to the font resource created in step 1
  4. Under Project Settings, go to Gui > Theme and set the Custom Theme property to the theme created in step 2
  5. Create and run a scene that has GUI controls with text

Minimal reproduction project:

CustomThemeFontTest.zip

@Calinou
Copy link
Member

Calinou commented Feb 27, 2020

Does it work if you define the Theme resource on your scene's root Control node? I generally advise doing this in every Control-based scene rather than relying on the custom theme project setting.

@AaronWizard
Copy link
Author

Yes. If I assign the theme to the control itself the font works correctly.

Should I not use the custom theme project setting?

@atbigelow
Copy link

atbigelow commented Mar 28, 2020

Was just fighting this for the last 30 minutes or so. Font was showing up in the theme preview, but never applying to any controls when running.

As a note: you can achieve the same result by setting the project's "Custom Font" from Project Settings. I feel both avenues should work, however.

@MHillier98
Copy link

I've found the same issue - new user here, following HeartBeast's Mobile RPG tutorial.

Setting the "Custom Font" and then reloading also made it work for me, but I would have assumed that the custom theme's font should have applied.

@giulianob
Copy link
Contributor

Does it work if you define the Theme resource on your scene's root Control node? I generally advise doing this in every Control-based scene rather than relying on the custom theme project setting.

I actually wouldn't recommend this. I used the Godot editor's theme as a starting point and it ended up completely crashing the editor when I had it assigned manually. The editor would just get slower and slower. So be very careful it seems there's some issue if you assign it to every control.

@Calinou
Copy link
Member

Calinou commented May 20, 2020

@giulianob This is because the editor theme contains lots of resources that will be serialized as Base64 (such as icons) once you convert it to a project theme. I think we should remove that option entirely or severely discourage it. If you plan to use it, at the very least, you should save it as a .res file instead of a .tres file (or manually remove the built-in icons/save them as external resources).

See also #33902.

@giulianob
Copy link
Contributor

@Calinou I did clear out all of the editor icons and saved it as a res file. Would you say it's now safe to set it on the controls directly or would you still expect me to run into issues where it freezes the editor?

@Calinou
Copy link
Member

Calinou commented May 22, 2020

@giulianob It should be safe to use in this case.

@RabbitB
Copy link

RabbitB commented Jan 8, 2021

I think we should remove that option entirely or severely discourage it. If you plan to use it, at the very least, you should save it as a .res file instead of a .tres file (or manually remove the built-in icons/save them as external resources).

Please do not remove this option; I create a lot of small utilities, and this is basically the only way I have of making a quick, decent looking and usable theme. I make some quick changes to the editor, save it as a theme and I'm ready to go. I don't have the time to spend hours on this for every minor project.

If it's a serious issue, please consider adding an additional dialog when creating from an editor theme, that allows you to quickly select only the theme elements you actually need (plus an "all" button if you truly need a full theme layout.)

@YuriSizov
Copy link
Contributor

Is this still an issue on master after #47544? I've improved theme propagation including better recognition of styles from the project and the default themes while working on it.

@MewPurPur
Copy link
Contributor

Seems to still be an issue in Godot 3.4

@grimmtotal
Copy link

This is still an issue for me

@akien-mga
Copy link
Member

Fixed by #55497.

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