#150428 - bojecka - Mon Feb 04, 2008 1:37 pm
Hi I am new to nds development and I was wondering how do you create your own font for the nds? I saw the custom_font example with DevKitPro and I am not really sure how what the numbers mean (especially fontData[]) and how do they work. Need help! thanks! :D
#150430 - silent_code - Mon Feb 04, 2008 2:00 pm
which part is it that you don't understand? i guess it's the "setting up a custom font in code", right?
if it helps, there's a demo on my site, that among other things, uses a custom font. if you don't understand some lines of code, post them and write down what problems you have with it. to me, your post sounds like you're not only an nds beginner, but also a c/c++ programming beginner.
i'd be glad to help!
#150434 - silent_code - Mon Feb 04, 2008 2:44 pm
oh - ok!
first you better edit that huge array out of your post... ;^)
well, for my font, i made an image and converted it to a raw data file (essentially just the binary form of the "numbers" in the array) to be loaded in the rom using a file system.
the other way would be to convert the image into a source file (just as you pointed out) that can be included into your code and compiled in, so you don't need a filesystem.
a very good converter is (win)grit, by cearn. it convertes images to raw as well as source files (among others). try that!
i actually have written my own converter, that writes my .pbi format, but that's just a detail (it contains a little header with image dimensions etc, the palette and the image data).
ps: those numbers represent each two 8bit pixels (or indexes into the color palette) packed into one 16bit value. there should be a palette array, too, that holds 256 color values, each 15bit in a 16bit number.
in short: that's the image data of all available console characters. each character is a 8 x 8 pixel tile cell.
NOTE: cearn has also written a very good gba programming manual, TONC, which i reccomend reading if you're just beginning - even if your target platfrom is the nds!