Beta 5 Bug: Missing fonts in engine
by Chris McKillip · in Torque 3D Professional · 09/16/2009 (3:11 pm) · 7 replies
Hello,
I've installed Torque 3D Beta 5 and am having some trouble viewing text. I can see all of the text in the toolbox, but once I switch over to the world editor, GUI editor, etc. the engine doesn't show any of the text, even in the console. Here's a screenshot:

I tried unsinstalling and reinstalling Torque, DirectX, and my video drivers, but still have the problem. I'm an AMD Athlon 64 X2 2.2 GHz, NVIDIA Quadro FX 3000 256 MB, and 2GB RAM on Vista Business 64.
I've installed Torque 3D Beta 5 and am having some trouble viewing text. I can see all of the text in the toolbox, but once I switch over to the world editor, GUI editor, etc. the engine doesn't show any of the text, even in the console. Here's a screenshot:

I tried unsinstalling and reinstalling Torque, DirectX, and my video drivers, but still have the problem. I'm an AMD Athlon 64 X2 2.2 GHz, NVIDIA Quadro FX 3000 256 MB, and 2GB RAM on Vista Business 64.
About the author
#2
09/22/2009 (5:19 pm)
Maybe your account is denying Torque write access to wherever it's installed, preventing the font caches from being generated. Try installing to desktop or on your User folder.
#3
09/22/2009 (7:08 pm)
Also be sure to run in Admin mode.
#4
For development, yes, people should run T3D in admin mode, since it *needs* to write a whole bunch of stuff to where it's installed (cached DTS files, decal data, terrain data, DSOs, etc). But some run-time writes like prefs, config and the console.log should go into somewhere in the user's app data folder, so release builds can be used by non-admins.
09/23/2009 (10:34 am)
@Matt: are there any plans to get around these user permission problems? For development, yes, people should run T3D in admin mode, since it *needs* to write a whole bunch of stuff to where it's installed (cached DTS files, decal data, terrain data, DSOs, etc). But some run-time writes like prefs, config and the console.log should go into somewhere in the user's app data folder, so release builds can be used by non-admins.
#5
Try substituting WinFont::create in platformWin32/winFont.cpp with:
The previous implementation was not parsing out face names correctly.
BTW, write access is not critical here. It's only needed for *writing* out font caches. If this fails, the only effect will be that fonts will be recreated from scratch on each run.
09/23/2009 (7:10 pm)
Try substituting WinFont::create in platformWin32/winFont.cpp with:
bool WinFont::create(const char *name, U32 size, U32 charset /* = TGE_ANSI_CHARSET */)
{
if(name == NULL || size < 1)
return false;
if(charset > NUMCHARSETMAP)
charset = TGE_ANSI_CHARSET;
U32 weight = 0;
U32 doItalic = 0;
String nameStr = name;
nameStr = nameStr.trim();
bool haveModifier;
do
{
haveModifier = false;
if( nameStr.compare( "Bold", 4, String::NoCase | String::Right ) == 0 )
{
weight = 700;
nameStr = nameStr.substr( 0, nameStr.length() - 4 ).trim();
haveModifier = true;
}
if( nameStr.compare( "Italic", 6, String::NoCase | String::Right ) == 0 )
{
doItalic = 1;
nameStr = nameStr.substr( 0, nameStr.length() - 6 ).trim();
haveModifier = true;
}
}
while( haveModifier );
#ifdef UNICODE
const UTF16* n = nameStr.utf16();
mFont = CreateFont(size,0,0,0,weight,doItalic,0,0,DEFAULT_CHARSET,OUT_TT_PRECIS,0,PROOF_QUALITY,0,n);
#else
mFont = CreateFont(size,0,0,0,weight,doItalic,0,0,charsetMap[charset],OUT_TT_PRECIS,0,PROOF_QUALITY,0,name);
#endif
if(mFont == NULL)
return false;
SelectObject(fontHDC, fontBMP);
SelectObject(fontHDC, mFont);
GetTextMetrics(fontHDC, &mTextMetric);
return true;
}The previous implementation was not parsing out face names correctly.
BTW, write access is not critical here. It's only needed for *writing* out font caches. If this fails, the only effect will be that fonts will be recreated from scratch on each run.
#6
@Rene: I found this in the console log, which looks like it might be the source of the problem:
- Loading card profiles...
- Loaded card profile core/profile/D3D9.cs
- No card profile core/profile/D3D9.QuadroFX3000.cs exists
- No card profile core/profile/D3D9.QuadroFX3000.QuadroFX3000.cs exists
- No card profile core/profile/D3D9.QuadroFX3000.QuadroFX3000.71500109685.cs exists
Failed to create resource: [core/fonts/Arial Bold 20 (ansi).uft]
Not entirely sure what that means, though. I'll try the code substitution and see if that helps.
@Manoel: The engine is already installed in a user folder.
@Matt: Running as admin doesn't seem to fix the problem.
09/24/2009 (1:35 pm)
Thanks for the advice, guys.@Rene: I found this in the console log, which looks like it might be the source of the problem:
- Loading card profiles...
- Loaded card profile core/profile/D3D9.cs
- No card profile core/profile/D3D9.QuadroFX3000.cs exists
- No card profile core/profile/D3D9.QuadroFX3000.QuadroFX3000.cs exists
- No card profile core/profile/D3D9.QuadroFX3000.QuadroFX3000.71500109685.cs exists
Failed to create resource: [core/fonts/Arial Bold 20 (ansi).uft]
Not entirely sure what that means, though. I'll try the code substitution and see if that helps.
@Manoel: The engine is already installed in a user folder.
@Matt: Running as admin doesn't seem to fix the problem.
#7
Not sure what's going on there beyond that as there is no font rendering at all. Not finding a font in the cache will just cause it to be loaded from the system. Maybe that fails. Or maybe it's something else.
Windows' CreateFont is rather forgiving in terms of passing in nonsense face names (like the old code did) so it actually *should* still work in most cases.
09/24/2009 (1:48 pm)
The log stuff is fine. Even the failed resource creation only says it couldn't load the font cache.Not sure what's going on there beyond that as there is no font rendering at all. Not finding a font in the cache will just cause it to be loaded from the system. Maybe that fails. Or maybe it's something else.
Windows' CreateFont is rather forgiving in terms of passing in nonsense face names (like the old code did) so it actually *should* still work in most cases.
Associate Rene Damm
Strange. Looks like all the platform font file creation fails.
What errors do you see in the console.log file in your game directory?