• 2D
  • What is the correct way to import a bitmap font (we get load errors)?

Hey, We imported 3 separate bitmap fonts ( using fnt and png file) through the Godot Import>Fonts dialogue. This worked fine and all the fonts works as expected. But when we commit the fonts and the scene file to Git, my colleague gets a load error (see image). I placed the original fnt and png file outside of the project since new files are created in the project when using the font importer.

But for some reason it's looking for the png in the path where I placed the original font files "calibo and redvalue". - These are placed in D/Fonts (outside the project).

This makes no sense however, since Godot creates it's own png file with the "cv.png" extension, but the image is exactly the same as the original file. So why is Godot looking at a global path outide my project. Are we doing something wrong or is this a bug?

Godot 2.1.1 and Windows 10.

Hello!

I've found when working with 3D models and the scene importer, this issue sometimes occurs as well. The way I found to fix it is to re-import the 3D model again with the scene importer, and that almost always fixes the issue (though a couple times it took another re-import to fix)

I have a hunch that the font files work the same way, so maybe re-importing will fix it?

I'm making an assumption based on my own experience (I admit I know little of how the engine works under the hood :) ), but I think the issue has something to do with checking if the files have changed, since Godot automatically imports changed files. Somewhere it seems to store the absolute path, and it (for some strange reason) uses the files in the absolute path over the files in the project. I'm fairly certain it's a bug though, since I cannot see any reason why it would want to use the files in the absolute path instead of in the project. (though there could be a good reason, I'm just not personally aware of any :) )

One way to check if you've fixed the problem is to import the fonts, then rename the folder you imported from and see if it complains.

Hope this helps!

Hey TwistedTwidleg, Thanks for you comment.

We already tried this (not multiple times though). But when my colleague got the path errors on his machine he tried re-importing all the fonts and pushed the changes back to me, resulting in me getting the path errors.

  • So for now we are using the solution: "Don't commit font changes" and it works alright for now :)
24 days later