-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
No fonts in project manager if using custom theme. #48477
Comments
@JestemStefan Hey, which doc is this lifted from? I've actually addressed this propagation problem in one of my PRs so I would need to update the docs if/when it gets merged. |
@JestemStefan I'm sorry but I don't understand. How would applying theme to control node instance would affect Godot editor? Are we on same page? I'm not using theme for any gui scene for game but for editor itself. |
I have set default font in theme resource. So it should use it globally if I have not set them somewhere. |
This does seem like an independent issue, yes. |
OK. I thought you are talking about custom theme for GUI. It seems like similar bug (propagation of the theme), but I didn't know about this one... maybe they are related? Someone more advanced need to look into it. |
This comment has been minimized.
This comment has been minimized.
@Calinou Removing it would be really sad cause it's a really cool feature! I think custom theme for editor which uses the resource created by the editor is pretty fascinating. Plus, it gives users a prime example of Godot's capability to theme components without manually updating them. Hack we can even put some example on wiki so users can just browse editor with applied theme and check how it works without creating a whole scene with control skinning cause that has its own learning curve. This way new users who are still considering Godot can check out how GUI skinning works without actually learning Godot. And it should be recommended on features page (If custom theme is fixed). |
We can have a demo project for that 🙂 I made a GUI Theming Override demo in the official demo projects repository last year. PRs are welcome to add theme selection to it (e.g. switching between a dark and light theme).
That's something that could be exposed either by allowing negative contrast values or adding a new setting 🙂 I would prefer we improve the built-in theme customizations (to a reasonable extent). Also, the |
|
? Do you mean |
Yes, but I removed my comment as I realized the theme resource is in the MRP. (I was on mobile when I wrote the above comment.) |
I have improved one if you want. Older one had colors that I hadn't modified. |
I take personal responsibility to make sure custom theme resources for the editor are in a working order. I see no reason why we wouldn't support a fully custom theme resource, if there are users willing to take time to create one. We use our internal Theme resource in an axiomatic way, so everything should be overridable. A few bugs are not a good reason to just cut it. I would even argue we don't make our customization options more complicated. I like that Godot's theme can be adjusted in a very simplistic way. For everything more complex, there is (and will be) the Theme editor. |
This is how the bug manifests itself with the Note that fonts are handled differently in the In 3.3: Only the bold font is missing. A custom theme could provide one by adding a font named Edit: It's possible, see below. |
I think the confusion stems from the fact that all fallback fonts are disabled as soon as one custom font is provided. We should keep providing fallback fonts for any fonts that weren't overridden. |
Yah that's what I was talking about. cursor was on doc bold so that popup came up lol |
I can quickly check the fallback theory but what is a safe options for fallback font? I mean which font should I use for fallback? |
You can use any font you want, but of course, you should use a bold font file if you want the font to be displayed in bold. |
Umm I think Godot configuration broke. After I compiled and ran Godot from master branch. 3.3 one stopped applying theme to the project manager. I deleted the .config folder in home dir but issue still persists. Any solution to this? |
Godot 3 and 4 use different configuration files (see File paths in Godot projects for their location). This is specifically done to avoid breaking the editor settings every time you switch versions. Also, in both 3.3 and |
@pycbouh how does Godot find project icons then? |
By manually adjusting the Ref<Image> img;
img.instance();
Error err = img->load(item.icon.replace_first("res://", item.path + "/"));
if (err == OK) {
img->resize(default_icon->get_width(), default_icon->get_height(), Image::INTERPOLATE_LANCZOS);
Ref<ImageTexture> it = memnew(ImageTexture);
it->create_from_image(img);
icon = it;
} |
I just double checked and Godot's theme file, when asked to set by editor, does not use path in context to any project because theme file can be anywhere in the system. So a resource which is not in any project should not use 'res://' for its sub resources. Aren't sub resources embedded in '.res' or '.tres' file? |
They can be, but it's not a requirement. Subresources can also be saved to external |
The theme resource you've presented has an example of both: images are packed into it as a byte array, but fonts (DynamicFontData to be precise) are external:
|
@pycbouh Is there an update on this? Project Manager is still "fontless" in 3.3.3.stable. |
We have no system for referencing resources globally (or relatively to each other for that matter), they can only be linked within a project with project-relative paths. So I don't think we can easily find a solution in the near future. I've not looked into the fallback issue, which should be solvable. In the end, we should probably disable custom themes in the PM due to these problems. Or at least sanitize it to remove external resources somehow (so that colors, for example, are retained, but not fonts or icons). Edit: I guess, an alternative solution can be in some way to "pack" the entire theme into one resource file, so there are no external resources? I don't remember, though, if that would cause issues for fonts or not.
Isn't it just a header of a Tree control? PS. Quite nice flat design you've got there! Good job. |
What about forcing of fonts as embedded resource in theme file?
That's sounds good. A user doesn't spend too much time in Project Manager anyway. Most of the session is spent in editor so having only editor affected by theme is reasonable.
Unfortunately, current theme resource has no property to modify header of tree control. As you can see in bottom left corner, I have already customized whole tree control. Thanks! |
I checked, and it's definitely the title row. It seems to be drawn using the following properties:
The relevant code is here: https://github.com/godotengine/godot/blob/3.3/scene/gui/tree.cpp#L3057-L3072 |
Got it! Thanks a bunch! |
@pycbouh I just tried 3.4 beta and Project Manager has default fonts! It's perfect! |
Isn't project name still missing? Or is that an issue with your theme? 3.4 supports partial editor themes, so it should fill the gaps for missing stuff, but I'm not sure it's the complete cure. |
Whoops! Totally missed that in excitement but that's an improvement for sure. Only titles are missing cause they use Bold fonts? It was produced in master:
|
Do note that the in 3.3.stable; second shot has all the fonts except title but current 3.3.3.stable has no fonts at all. |
Sadly, I can not confirm whether 3.4 fills the gap left by custom theme cause beta5 crashes when custom theme is applied. #51648 should fix it though. Then, I'll confirm again if default fonts work for project title and everything then I don't think we need more solid solution. At least not any time soon. But if 3.4 fails to show fonts then I guess we can keep this issue reopened for a reminder. |
#51648 is in beta5... |
Whoops! Should I reopen #52530 then? |
If you think it's the same crash, sure. But make sure to update the reproduction steps for 3.4. And if you can, attach the resource that causes the problem. In the meantime, should this one still be open perhaps? |
Yes but I'll reopen tomorrow. I'm commenting from phone app and I can't find the option. |
This was fixed by #51648 |
Godot version:
3.3-stable
Issue description:
If I set custom fonts in editor theme resource, fonts won't show up in project manager. It is not even using any kind of fallback fonts.
Steps to reproduce:
Set theme file given below as custom theme in godot editor. Then press
Ctlr+Shift+q
to go back to project manager and it will not show fonts. Now go back to any project and copy theme in project folder. Edit it in inspector and just remove default font option. Now go back to project manager. Some of the font's come back except for few places. That's because theme is overriding more fonts in sub properties. If you remove all custom fonts. Everything will show properly .Minimal reproduction project:
material.zip
The text was updated successfully, but these errors were encountered: