-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Bugs when setting BitmapFont in Project Settings #52262
Comments
Here's a stacktrace from trying to open the script editor after having deleted the
|
4.0-dev also has this problem. If you specify a font in the Project Settings or set it in the default theme, the project will load endlessly, without errors in the console. It looks like there is indeed some kind of error in the project load order related to images. |
I researched this problem in 4.0, MRP was hard for me. For some reason, Steps to reproduce:
Note that this only applies to 4.0, I haven't tested it in 3.x and I'm guessing something else (but possibly similar) is causing the problem. |
Seems like it caused by tab size being zero (which is caused by zero space size), and it's stuck here trying to align the line to the tab offset: godot/modules/text_server_adv/text_server_adv.cpp Lines 3690 to 3696 in 9f05867
|
Should probably open a new issue for that then. 🙃 Doesn't seem to be related to the OP. |
Click to expanddiff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp
index 5eb55f4584..aeb04f50c1 100644
--- a/modules/text_server_adv/text_server_adv.cpp
+++ b/modules/text_server_adv/text_server_adv.cpp
@@ -3681,6 +3681,12 @@ float TextServerAdvanced::shaped_text_tab_align(RID p_shaped, const PackedFloat3
const_cast<TextServerAdvanced *>(this)->shaped_text_update_breaks(p_shaped);
}
+ for (int i = 0; i < p_tab_stops.size(); i++) {
+ if (p_tab_stops[i] <= 0) {
+ return 0.f;
+ }
+ }
+
int tab_index = 0;
float off = 0.f;
diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp
index 09adeacfe0..77f26958bb 100644
--- a/modules/text_server_fb/text_server_fb.cpp
+++ b/modules/text_server_fb/text_server_fb.cpp
@@ -2665,6 +2665,12 @@ float TextServerFallback::shaped_text_tab_align(RID p_shaped, const PackedFloat3
const_cast<TextServerFallback *>(this)->shaped_text_update_breaks(p_shaped);
}
+ for (int i = 0; i < p_tab_stops.size(); i++) {
+ if (p_tab_stops[i] <= 0) {
+ return 0.f;
+ }
+ }
+
int tab_index = 0;
float off = 0.f;
A quick fix for a tab issue. But I'm not sure why it's trying to set TextEdit font to the random one when you are opening arbitrary script, there's something else wrong as well. |
Yes, I tested, the problem is really in the tabs. (Tabs! I was your faithful follower, and you betrayed me! I am switching to spaces. 🤣) |
Since the problem has been fixed in all branches, I close this issue. @bruvzg The tabs issue needs to be fixed separately. Should I open a new issue for this? EDIT: Although curious why the |
Godot version
3.3.3, 3.4 beta 4, 4.0-dev
System information
Kubuntu 21.04
Issue description
Setting BitmapFont as a custom font in Project Settings (
gui/theme/custom_font
) brings up strange bugs that are slightly different in different projects and different versions of Godot. That said, it used to work correctly before (in 3.2), and even in these versions the font worked without any errors until I re-generated it.I don't know if this bug is OS dependent. The only assumption is that this bug occurs due to the wrong order of code execution (race condition?). In this case, in the future, both resources (both the texture and the font) are loaded correctly, you can see this in the editor and in the running project.
I managed to catch crashes in both versions when starting the editor. If you delete the
.import
folder, then in 3.4 beta 4 the editor will start normally, but the font will not work globally (only locally), and the same 7 errors will be displayed when the project starts.Real project, Godot 3.3.3
Real project, Godot 3.4 beta 4
MRP, Godot 3.3.3
MRP, Godot 3.4 beta 4
Steps to reproduce
See MRP.
Minimal reproduction project
tmp35.zip
The text was updated successfully, but these errors were encountered: