<p style=”text-align: right;”>این تابعی هست که من باهاش فونت رو از آرایه میخونم و چاپش میکنم.</p>
<p style=”text-align: left;”>void tftlcd_putchar(char character,int forground_color,int background_color,int transparent_mode,int y_offset)
{
int width_counter,length_counter;
int character_segment_data;
for(length_counter=0;length_counter<16;length_counter++)
{
character_segment_data=font8x16[character-0x20][length_counter];
for(width_counter=0;width_counter<8;width_counter++)
{
if(character_segment_data & (0x80>>width_counter))
tftlcd_write_pixel((x_text*8)+width_counter,(y_text*16)+length_counter+y_offset,forground_color);
else
{
if(!transparent_mode)
tftlcd_write_pixel((x_text*8)+width_counter,(y_text*16)+length_counter+y_offset,background_color);
else
tftlcd_write_pixel((x_text*8)+width_counter,(y_text*16)+length_counter,tftlcd_read_pixel((x_text*8)+width_counter,(y_text*16)+length_counter+y_offset));
};
};
};
if(++x_text>TS_SIZE_X)
{
x_text=0;
if(++y_text>TS_SIZE_Y) y_text=0;
};
}</p>