Could not initialise fonts?

Get help with compiling or installing the game, and discuss announcements of new official releases.

Moderator: Forum Moderators

Post Reply
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Could not initialise fonts?

Post by Dugi »

Hello,

I have a new laptop and after setting up all the stuff I needed, I proceeded to compiling wesnoth. I was using my modified version that is waiting on its pull request because I didn't have much time to finish it. I set up all the dependencies, compiled it, and now it crashes with this report when I tried to launch it.

Code: Select all

Battle for Wesnoth v1.13.0-dev (3befb55-Modified)
Started on Sat Jun  7 15:58:21 2014


Data directory: /usr/local/share/wesnoth
User configuration directory: /home/dugi/.config/wesnoth
User data directory: /home/dugi/.local/share/wesnoth/1.13
Cache directory: /home/dugi/.cache/wesnoth
20140607 15:58:21 error filesystem: Trying to open file with empty name.
20140607 15:58:21 error config: Could not open file 
could not initialize fonts
I think the problem was related to the fact that in order to avoid a large download from git (both because it's lengthy and a waste of resources I haven't paid for), I copied the old repo from my old laptop (I didn't copy the compiled stuff). Maybe I've made a mistake somewhere, but I can't find where. It worked on the old laptop. Git works when used on the folder. The compilation didn't throw any warnings. Wesnoth 1.10 installed from the ubuntu server works without issues.

Has anybody experienced an issue like this? What might be the cause?
User avatar
iceiceice
Posts: 1056
Joined: August 23rd, 2013, 2:10 am

Re: Could not initialise fonts?

Post by iceiceice »

Dugi:

I would suggest to just do the lengthy download from git, because it will guarantee that it is set up exactly as it was meant to be. Sure I guess it's resources you didn't pay for, but the alternative is to spend your time working through potentially complex issues like this. It's a publicly offered download, so imo you should feel welcome to it, especially if it will save you time.

If that doesn't fix your problem, it might be that your new filenames contain strange symbols that are confusing the file system code? This code has been overhauled recently to try to more properly support utf on all platforms that wesnoth is compiled on, so it might be related, it's hard to say.

See also: http://www.utf8everywhere.org/
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Could not initialise fonts?

Post by Dugi »

I think that the fonts problem is rather a consequence of the earlier Trying to open file with empty name problem, but that doesn't matter anyway. Thanks for trying to help. The UTF-8 article is quite interesting, does this UTF-8/UTF-16 duality cause trouble on Windows or Linux?

I'll have to download that thing again, spend 6 hours hoping that the connection will not be interrupted... Or is there an easier way to get a local copy of https://github.com/wesnoth/wesnoth/pull/134 if I have the files?
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Could not initialise fonts?

Post by AI »

What do git status and git describe output? If you copied the .git directory, the repository itself should be fine.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Could not initialise fonts?

Post by Dugi »

Thanks for helping.

Git status tells:
I didn't edit any of these files (except the untracked ones), I don't even know python:
Git describe tells: 1.11.11-273-g3befb55
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Could not initialise fonts?

Post by AI »

Did you intend to be on that branch? You're not tracking master or 1.12, if that was your intention.

Anyway, if you didn't make any of those changes, you can just git reset --hard to get rid of them.
User avatar
Iris
Site Administrator
Posts: 6797
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Could not initialise fonts?

Post by Iris »

Dugi wrote:

Code: Select all

Data directory: /usr/local/share/wesnoth
Unless you are certain that you installed Wesnoth there (which is usually not necessary), odds are that the Wesnoth binary you are trying to run isn’t at the root of the source dir (i.e. $(dirname `readlink -e /proc/$(pidof wesnoth)/exe`)/data/_main.cfg doesn’t exist or is not readable).

If relocating it isn’t an option or you don’t mind typing out the path each time/adding it all to a script, you can specify a relative or absolute path as the last argument to the Wesnoth executable to point it to the right location for its data dir.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Could not initialise fonts?

Post by Dugi »

I have also tried copying the files there, but it didn't help. But now I tried to check the permissions and I found that all permissions were somehow set to totally inaccessible for all users except root. sudo chmod -R a+r /usr/local/share/wesnoth/ did not fix all the permissions properly (for some reasons, I still can't access data/gui without root permissions), but I was able to run wesnoth as root - which is not the best solution, but at least it proves that the problem is in permissions. This isn't a wesnoth problem anymore, rather a Linux problem. Thanks for advice.

EDIT: Fixed that problem as well, for some reasons doing it in nautilus running as root fixed it.
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Could not initialise fonts?

Post by AI »

Dugi wrote:sudo chmod -R a+r /usr/local/share/wesnoth/ did not fix all the permissions properly (for some reasons, I still can't access data/gui without root permissions)
Directories need to be executable or you can't enter them. find /usr/local/share/wesnoth -type d -print0|xargs -0 chmod +x would fix that.
User avatar
Iris
Site Administrator
Posts: 6797
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Could not initialise fonts?

Post by Iris »

Let me repeat myself again: you do not need to install Wesnoth or its data files to run it. If you are going to do mainline coding work, you are wasting your time by even contemplating that option.
shadowm wrote:If relocating [the binary to the root of the source tree per the technical discussion in this blog post] isn’t an option or you don’t mind typing out the path each time/adding it all to a script, you can specify a relative or absolute path as the last argument to the Wesnoth executable to point it to the right location for its data dir.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Could not initialise fonts?

Post by Dugi »

@AI
Next time, I'll remember that there is a better solution to this issue.

@shadowm
It's useful for me for having the data installed and running the executable from the compilation folder. My laptop has a small SSD and a normal hard disk (using the SSD as Linux system drive to start programs immediately). I am making a lot of changes to the executable and minimum changes to the other files. So, it's useful for me to have the executable on the hard disk where a lot of rewrites isn't a problem and the other files on SSD for swift startup.
Post Reply