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
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
Torque Owner Alexis Paris
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