PocketMatrix forums

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

Loading A font

Hi i notice this is how you load a VGA font from
a resource

FindResource(_Module.GetModuleInstance(), MAKEINTRESOURCE(IDR_WACKY_FONT), TEXT("FONTS"));

How would i do this manually, is it possible..?
I'm not sure what you mean by manually... could you elaborate a bit?
i meant can i load the font as i would an external image. i do not wish to compile my resources at the moment
Sorry, that functionality isn't included at this point. However, the font drawText function simply requires an unsigned char* to the font data (as I recall, be sure to check the code to be sure I remembered correctly), so you can load it yourself without any problem.
so i could use basic IO functionality to read the font and cast this data to a char..?
Yes, I believe so (leaving room for being wrong of course :)). The fonts are all a standard size (4096 bytes if I remember correctly), so it's always the same size read buffer. As I said, just check to be sure I got the right data type and that should work fine. Once Thierry gives us a new PF version, I'll see about adding the ability to load from a file for DrawText.
I have not tried this myself as my PocketPC is having a days holiday today, but if i can get something to work, should i send it to you
Sure, send away. Thierry is going back a revision when he releases a new PF, so I'm not going to be releasing any interm versions, I'll wait until his new version is out before I do anything (at which point I'll most likely just ask him to add the code anyway).