Writing from an array to an LCD's memory

I have a graphical display that has on-board memory (RAM). I need some instruction as to how I'd take values from an array and write it to a specific memory address in this RAM.

For example, I found a font which has been rendered in hex values in an array (from the GLCD library). A link to this header file is here: http://drop.io/xldrxhl/asset/arial14-h

It contains data that looks like this (this is a small sample):

    // font data
    0xFE, 0x14, // 33
    0x1E, 0x00, 0x1E, 0x00, 0x00, 0x00, // 34

I want to write this to the display's RAM, but it has me specify a "high byte" of the target memory address and a "low byte" of the target memory address. A sample write command looks like this:

void WRITE(int HighAddress, int LowAddress, int Data) {
select();
spi_transfer(0x00); //Write Command
spi_transfer(HighAddress); //High byte of the target memory address
spi_transfer(LowAddress); //Low byte of the target memory address
spi_transfer(Data); //The first value to be written, more may follow
}

//Deselect so that it knows there is no more data to be sent
void WRITEend() {
deselect();
}

Here are my questions:

  • How do I specify specific characters (or lines?) from the font array to be written to the RAM?
  • How does it know how much memory to fill up when I send the font data?

How does it know how much memory to fill up when I send the font data?

The font file you referred to has a section for "char widths" which tells you the number of bytes to fetch/send.
I suppose you could add up the widths for all characters before the one you want to print to find out where it starts.

Are you sure there isn't already some prewritten code intended to be used with that font?