The library for the e-ink display uses the simple XBM format [ wikipedia ]. The display board itself has flash memory to permanently store up to 255 sectors; for the 2,7" display, each image uses 2 sectors, effectively giving us space for up to 127 images.
For our project, each caracter uses 2 images: one for the big hanzi / kanji character and another one with the pinyin / romaji and its explanation. This, again, reduces by 2 the number of stored symbols, giving us space for about 63 pairs of character-information.
Again, if we use about 26 images for internal purposes ( welcome screen, information screens to display miscellaneous information ) this leaves us space for 50 characters, which is quite enough for daily usage :-).
At the moment, the program always uses the first two sectors (0, 1) to store the selected card and then display it, so we are not affected by the limits of flash capacity.
I used a cheap microSD card with 4GB of capacity. formatted under Windows 10 with FAT filesystem, and with the following file structure:
Pretty self-explanatory. The X-Y/CARDZ.XBM files contain the XBM image of each card. Its analogous EXPX-Y/EXPZ.XBM file contains the character definition card.
The file LVL.TXT contains an integer from 1 to 2499 that defines the user "level", that is, the number of cards the user should already know or is studying, and limits the higher reachable card using the device. I still have to think and implement a way to upgrade it: either automatically or by using the buttons/BlueTooth with Android program.
The file HIST.TXT stores a line with the timestamp, an space and the card ID for each card it is displayed. Example:
I don't know what will happen as the file grows up. I will probably make it clean up after each synchronization with the Android program...
You can skip this if you just use the pre-created images i published.
To create the image of each card I just downloaded and parsed the html table of a website (http://www.testvocab.com/chinese7_1.php, http://www.testvocab.com/chinese7_2.php, http://www.testvocab.com/chinese7_3.php).
Then, I created an SQLite database and inserted the parsed data:
CREATE TABLE chinese ( id int, hanzi text, pinyin text, translation text );
Using this databse, I wrote a python program that creates the card images
You can find all of this in the card_generator directory of the gitweb repository.
I published as a matter of curiosity, also you can use it to generate more cards, change its info, font, another language, etc. Maybe i make an online version of the script if i get any requests to do so, which i highly doubt :-).
The initial prototype has a total of 4 buttons: