Game Development Community

Font bug with quick Fix

by Alexis Paris · in Technical Issues · 09/10/2006 (9:01 pm) · 2 replies

I am using a not very popular Linux distribution called Frugal-ware 0.4 with xorg-server 1.0.2-1.
Torque compile with no problem but when you run it you got this msg "createFont: cannot load font".

After digging a little I found that it has something to do with line 250 (or close) in file x86UNIXFont.cc
"XftFont *fontInfo = XftFontOpenName(display, DefaultScreen(display), mFontName); "
The function was not creating the fontInfo.

A quick fix:

The real problem was this variable mFontName, it was defined somewhere

[ bool x86UNIXFont::create(const char *name, U32 size, U32 charset) ] as

mFontName = StringTable->insert(xfontname);

and for some reason it was not working.

But if you change that line for

mFontName = xfontname;

everything will be OK.

I hope this hel someone !!!

Alexis Paris

About the author

Recent Threads

  • TGB 1.7.4 on linux

  • #1
    09/19/2006 (11:28 pm)
    After playing a little more with torque I got the same problem as before ===> "createFont: cannot load font", but this time I did other quick hack ...

    In this file x86UNIXFont.cc change this line (250)

    XftFont *fontInfo = XftFontOpenName(display, DefaultScreen(display), mFontName);

    to this one

    XftFont *fontInfo = XftFontOpenName(display, DefaultScreen(display), "sans-serif");
    .
    As you can see just put a static font name on the last parameter of the function ...

    to see what fonts you have on your linux look at this file /etc/fonts/fonts.conf.

    no more fonts problem ...

    Alexis Paris
    #2
    09/21/2006 (12:21 am)
    Known bug and already fixed in t2d and Ron knows about it for tge.