Hey everyone!
So, I've got an ILI9341 2.8" TFT display, and it works great. I'm using cbm80amiga's ILI9341_Fast library.
My application involves printing some large bitmaps, enough to cover the whole screen. Problem is, bitmaps take up a lot of progmem space. I know I can store bitmaps on the SD card and print from there, but I'd rather use cbm80amiga's RREfont bitmap solution because of the flexibility, speed, and scalability of the graphics. I already use the RREfont library for displaying text in an efficient way on the screen, and I was able to find the example in the video linked above. I need to be able to recreate that video with my own custom image, that's the goal.
I understand how this example is working- a bunch of custom RREfonts were generated from a base bitmap (rre_mario0.h, rre_mario1.h, rre_mario2.h, etc). One of these fonts is generated per color on the original bitmap image. Those fonts are loaded in, and printing characters like " " or "!" print the bitmap as if they were text (text that happens to be shaped like Mario). I'm really impressed with the speed, and at how efficiently this entire mario bitmap image is stored in Progmem. Very ingenious solution- I just don't know how to get my OWN bitmaps into RREfont formats.
When I open up one of the "fonts" (mario0.h for example), I see it mentioning "generated by RREfontgen". So I checked that out, here it is. Got it downloaded, and I figured out how to use cmd to navigate to that folder and execute commands listed in the github.
What I don't know is- how do I use this rrefont software to go from my own bitmap image into files equivalent to the rre_mario0 font files used in his examples? Honestly, I need a bit of a step-by-step guidance for this stage. If I can properly generate those RREFont files, I think I can print them just fine. How did he go from a bitmap of our beloved Italian plumber into the rre_marioX.h files? Everything after that I've got a good understanding of.
What I've tried: I took a bitmap (some random 32x32 sprite), made it monochrome for sake of being simple. Then, I took a wild guess and converted .bmp to .pbm (because .pbm is mentioned in the rrefontgen github). Tried running the command "rrefontgen image.pbm 32 32 testfont" (following instructions for using rrefontgen in pbm mode). This didn't work, error said I needed to specify "w and h in pbm file". I expected this, given that these were wild guesses. Thought I'd come ask a more experienced community what I need to be doing here.
I'm decently experienced using Arduinos, but not experienced with more in depth coding, like compiling .c files, using cmd to execute programs, and such. Took a while to learn how to convert a bitmap to a regular byte array for printing on the display the old fashion way. Got that done, but quickly realized that larger bitmaps would eat up my progmem.
Thanks for your help!