Download designated user font

Description

Download designated user fonts to MCU or flash memory(if flash preinstalled).

For displays with flash memory installed:
  Exept 4 standard user fonts. All additinal fonts can be saved in any where in flash memory.

For V7 firmware: Fonts can also be saved as files in flash memory(V7) by using normal "write file" commands

Usage:

Direct:

 "SUFsld"

Arduino:

void downloadUserFont(int16_t l, const uint8_t *d, uint8_t s)

C:

void Digole_downloadUserFont(int16_t l, const uint8_t *duint8_t s)

Parameters:

s

The index number of user font, value must be one of 200,201,202,203.

l

The font's data length of bytes.

d

The pointer to font's data.

Return:

none

Example (Arduino):

const unsigned char[] myfont={......}; //define a user font
//use designated user font
mydisp.downloadUserFont(sizeof(myfont), myfont200); //save font:myfont to designated user font's space
mydisp.setFont(200); //use the new font
mydisp.print("Hello you!");

Example(direct)

serial.writeString("SUF"); //save designated user font command
serial.write(s); //specify the font index, 200~203
delay(600); //waiting about 0.6 seconds for the display erasing memory space
serial.write((uint8_t) (l / 256)); //the length of font's data in byte
serial.write((uint8_t) (l % 256));
char b = 0;
for (int j = 0; j < l; j++) { //write l bytes of font's data
serial.write(*(d + j));
if ((++b) == 64) {
b = 0, delay(40);//for every 64 bytes wrote out, pause 40ms, this is in order to compatible with older version of display, not required for displays with flash memory
}
}

Changelog

Version Description
   

See Also

Change current font

Save fonts to address in flash memory

Save font to file in flash memory