PocketMatrix forums

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

Why can't I load this font?

When I try to load the font below, I get error GDERR_INVALIDBITMAP all the time, and I can't figure out what is wrong.

The call happends when I cann CreateFont(0,NULL).

http://www.techlogic.ca/aw/has14.png

I tried to reduce the number of colors, change the size, etc. Can't get it to pass the CreateFont() call.

Thanks!

--Eric
mobile_fish · 08 Jan 2003, 20:16 UTC
In which place of your program do you use this call?
If you're using CGapiApplication class, then I think you have to do this only in CreateSurfaces(..) or in functions that was called after CreateSurfaces(...).
The font linked has the tracking info in it so you could use CreateFont(GDCREATEFONT_TRACKING,...).

You could also simply try CreateFont(GDCREATEFONT_SIMPLEBITMAP, 0), but with the tracking present I would expect you'll see those white lines in your font. Also I think the simple bitmap expects a certain width, so I would guess that based on the number of supported characters it would expect a file width that is # chars * width, and if that isn't true the font is invalid.

Those are just suggestions, the real problem might just be that those two flags I just mentioned are 1 and 2, neither of them are 0, and I have no idea what 0 is supposed to do.
Just had a quick look at the font.. You have to keep space between your characters so that GapiDraw can parse the fonts correctly (to me it looks like you missed to place some space between "'" + "a", and "i" + "j" for example).
sbl wrote:Just had a quick look at the font.. You have to keep space between your characters so that GapiDraw can parse the fonts correctly (to me it looks like you missed to place some space between "'" + "a", and "i" + "j" for example).


Indeed! I didn't knew there had to be a space between the characters themselves. I thought only between the tracking lines.

Thanks a million!

--Eric