Missing fonts/FreeSansBold.otf

Missing fonts/FreeSansBold.otf

Discuss everything related to running Spring on your chosen distribution of Linux.

Moderator: Moderators

Post Reply
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Missing fonts/FreeSansBold.otf

Post by SpliFF »

When trying to build and run spring on Gentoo I get the error

Code: Select all

[f=0000000] [Font] Error: Failed creating font: Couldn't find font 'fonts/FreeSansBold.otf'.
Error: Spring: Incorrect/Missing content:  Failed to load font: fonts/FreeSansBold.otf
I've installed the freefonts-ttf package but no dice. I think this font is supposed to be part of spring content so maybe that didn't install. Any clues what might be going on?

One thing that might be relevant is I'm using "make spring-default" && "make install-spring-default" rather than the more typical "make spring && make install" as I'm testing a new gentoo ebuild which allows you to choose whether you want headless, dedicated, multithreaded, etc.

The weird part is this:

Code: Select all

# locate fonts/*.otf
/usr/share/games/spring/fonts/FreeSansBold.otf
So I seem to have the font, just in the wrong place? Wrong install prefix?

The relevant ebuild line is:

Code: Select all

cmake-utils_src_make install-spring-${build_type} DESTDIR="${D}"
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Missing fonts/FreeSansBold.otf

Post by jK »

check the stdout/infolog, it names the dirs it searches in.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Missing fonts/FreeSansBold.otf

Post by hoijui »

also check the output of the "make install*" line, to see if it installs the font.
cant check anything right now, sorry.
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: Missing fonts/FreeSansBold.otf

Post by SpliFF »

It's ONLY using my home directory as a data dir.

Code: Select all

Using read-write data directory: /home/spliff/.spring/

Code: Select all

access("/home/spliff/.spring/fonts/FreeSansBold.otf", R_OK) = -1 ENOENT (No such file or directory)
open("fonts/FreeSansBold.otf", O_RDONLY) = -1 ENOENT (No such file or directory)
My .springrc is empty. I deleted it deliberately to make sure it wasn't masking any issues for new users of the ebuild.

So the question is, other than editing .springrc (which isn't a solution for other users of the ebuild) how do I tell spring to also use /usr/share/games/spring/ as a read-only directory at install/configure time?
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Missing fonts/FreeSansBold.otf

Post by jK »

check the original ebuild?
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: Missing fonts/FreeSansBold.otf

Post by SpliFF »

Sorry, I wasn't clear enough. My ebuild extends the original and the parts that seem applicable haven't changed.

Code: Select all

VERSION_DATADIR="${GAMES_DATADIR}/${PN}"
src_configure() {
   ...
   mycmakeargs="${mycmakeargs} -DCMAKE_INSTALL_PREFIX=/usr -DBINDIR=${GAMES_BINDIR#/usr/} -DLIBDIR=${LIBDIR#/usr/} -DDATADIR=${VERSION_DATADIR#/usr/}"
  
   cmake-utils_src_configure
}
The only relevant change I can think of is the original uses:

Code: Select all

src_install () {
    cmake-utils_src_install
    ...

... and the new version uses:

Code: Select all

src_install () {

    for build_type in default multithreaded headless dedicated
    do
        if use $build_type ; then
            cmake-utils_src_make install-spring-${build_type} DESTDIR="${D}"
        fi
    done
    ...
... because cmake-utils_src_install doesn't accept a target argument.

The only other MAJOR difference is spring itself.

Here's the new ebuild for reference: http://pastebin.com/bi8eyrJs
And the old: http://pastebin.com/d6pp8tib

I'm guessing the issue is soomething to do with this cmake arg: -DDATADIR=${VERSION_DATADIR#/usr/}"

I don't have a build log yet, but I can post one later if required.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Missing fonts/FreeSansBold.otf

Post by jK »

It's late so I won't investigate myself, but you might want to check the ebuild helper file that implements `cmake-utils_src_install` and see how `mycmakeargs` is handled.
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: Missing fonts/FreeSansBold.otf

Post by SpliFF »

I finally discovered what was wrong. I found I could run spring as root so it suddenly clicked it was a permissions issue. Turns out I forgot to add the user account to the 'games' group so the whole /usr/share/games path wasn't accessible.

I'd suggest in future spring provide some minimal log feedback when a datadir can't be read or doesn't exist. As things are there's no feedback to say why a datadir was ignored.
Post Reply

Return to “Linux”