PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

CGapiFont::CreateFont reporting back Invalid Bitmap in 1.02

Greets,

I ported my game to Gapi 1.02 and for some reason my font bitmaps are no longer working. So I wrote a little test program using the font file included in \GDFonts and again, same deal, reports invalid bitmap.

I'm at a loss as to what's happening. I'm using the file /GDFonts/SampleFont.png with the following code.

Code:

//Create Font
g_Font.CreateSurface( TEXT("SampleFont.png") );

//Initialize Font
g_Font.CreateFont( NULL, NULL );



Additionally, on the PPC the CreateSurface call fails as well. I have the png placed at the system root so I don't understand why it's not loading now. The error reported is that it can't find the file. Does GapiDraw 1.02 tack on the exe's path?

Thanks for any help with this,
-Lucas "Hosed" Goodwin
Just an update. It appears that GapiDraw 1.02 does tack on the exe's working path when you pass a file name to CreateSurface. I don't believe the documents mention this behavior.
Hi,

Yep.. I haven't been able to update the entire doc since my internet connection went down due to a thunderstorm last night.

GapiDraw checks if the filename begins with "\" or "x:\" and if so uses absolute filenames. Otherwise it will try to get the app path and use relative paths.

/Johan
How about the issue with the create font? What am I doing wrong for creating non-simple fonts?
Hi,

You probably forgot to set a colorkey. I noticed that I missed that step in the documentation. I've updated the docs for both CBitmapFont::CreateFont and CGapiSurface::CreateSurface.

Use the following steps:

CreateSurface
SetColorKey
CreateFont
DrawText

/Johan
Ahh, yes. Definately didn't do that part. Wasn't aware it was needed as the previous version didn't care.