hawkeye,
right now i don't have any code that would be useful to anybody else, unless they wanted to use my specific format. but i'm finding it limiting even for myself, so i'm going to work this afternoon to make it more universal.
my current method is to store an array[64][256] that simply contains 1's and 0's to tell whether or not a pixel should be on or off. this array is used for the entire region of the display. i'm going to change that to store 0-15 so the shade will be stored instead, which is why i asked my question earlier.
then i wrote a simple loop to read four slots out of the array at a time, and test them for on/off and write out the correct 2-byte codes to the display. it works great and i won't need to change it much for displaying the overall picture, except for changing the algorithm a little bit to account for shades. maybe this is the standard way of doing this, i don't know. i just started working out what makes sense to me as i don't have any previous experience in writing a display driver.
to draw my font, i wrote code specifically that would work with this font. i'd like to do it an entirely different way though, which i'll describe later. i have 3 functions to draw them: write_h_line and write_v_line will 'draw' horizontal and vertical lines into the main array based on starting x/y coordinates and length. a third function, write_pixel will write a single pixel based on x/y coordinates. calling them has to include whatever offsets i want (tall/short letter, etc). so when i feed in a string like "this", it loops each character, writes each to the main array, and puts an extra pixel for spacing. i just keep a running counter to show where the x-coordinate is for the start of a letter.
i'd like to just store fonts in different files. i like to have space available on both the top and the bottom to account for letters such as 'h' and 'g'. so for example, if i account for a font being 11 px tall (7 for a short letter like 'o', two px above that for a letter like 'h', and two below that for a letter like 'g') and want to write 'h', it'll be stored like this:
1000000
1000000
1000000
1111111
1000001
1000001
1000001
1000001
1000001
0000000
0000000
that's essentally an 'h' in the superpoint square font. but the same engine could easily read other fonts if the 1's and 0's (or actually, the value representing the shade) was stored for it.
my biggest setback is that i'm really not that great at C, and OOP makes more sense to me. i want to store data that contains the following information:
font name
overall font height
each character of the font, which has the following:
width (if even necessary)
left offset (i posted a pic below to show what that means)
an array storing the 1's and 0's (or shade values) that can be returned to the function calling it,a nd then inserted into the main array
i think i just need to learn more about defining types to store this data, and using pointers to make the array usable. i'll figure that out this afternoon maybe.
once this is done, and a small library of fonts are stored, the programmer or user could just select a font based on name, then size (i find that odd # sizes work best), and then write the letters where they want.
also i'm wondering how to handle words that are bigger than the space allowed (i want to code this to let the user define regions like you said), so if a word is too wide, it gets truncated. my thoughts were 'truncate' would turn into 'trunca.." if there wasn't enough space. if i go that route, i already have a good idea of how to do it. also, i'm going to incorporate left/center/right justification based on the user defined region.
anyway, i'm not really looking for you to answer anything unless you can tell me what's best for storing/retrieving the font data. i'm just throwing out what i've figured out so far and hoping for somebody to tell me if i'm going about it the wrong way.
the attached image shows what i mean by 'left offset'. the lowercase 'j' got it's own bit of code, which (if it's not the first char) backs up the counter to make the bottom part of the 'j' wrap around the previous letter. maybe switching from windows to a macbook has made me put too much emphasis on style. :P