Irrlicht fails to load a font if the font is in FileArchive with use paths set to true with the error "Could not open file of texture: font0.png"
The file names for the textures in the font are relative to the location of the xml file. Therefore some method to resolve the file names is needed.
Currently this is done by changing directory to the folder containing the xml file and then using the standard load texture functions, which then fails for one of the following reasons:
1) If the file list system is native then it's changing the directory on the native system but the file is on the virtual part of the file system.
2) If the file list system is virtual instead then it changes the right directory but the createAndOpenFile function which is used to open the ignores the working directory set for the virtual file system and if the archive is set to use paths then this doesn't find the texture either
To fix this one option would be to make createAndOpenFile use the virtual working directory as this would make that function work the same for both virtual and native filesystems. The other option would be to change the font loading code to instead of changing directory some how tell the font where it should load the textures from.
I have attached a demo that tries to load a font both using the native and virtual filesystems as the current file list system. In both cases it failes to find the textures. It is a .tar.gz as it requires the font to be in the right location to be able to load.
I am using 1.7.0 but have checked by looking at the source code that the relevant code hasn't been changed in the svn trunk.
Font Loading bug
-
- Posts: 2
- Joined: Mon Jan 21, 2013 12:30 pm
Re: Font Loading bug
I stuck this on the official bug tracker as I didn't remember I was meant to post here first.
The attachment is on the bug report but I can't seem to attach files here so have included the link to the report below.
https://sourceforge.net/tracker/index.p ... tid=540676
The attachment is on the bug report but I can't seem to attach files here so have included the link to the report below.
https://sourceforge.net/tracker/index.p ... tid=540676