Pages: [1]   Go Down
Author Topic: Nokia 6100 Library font fix  (Read 1609 times)
0 Members and 1 Guest are viewing this topic.
Leeds, UK
Offline Offline
Full Member
***
Karma: 0
Posts: 134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

I picked up a 6100 LCD Breakout Board a few days ago, and with the help of this handy thread managed to get it working nicely, using the library available here.

The text display was an issue though, with the letters coming out a bit stretched and ugly looking.



This was apparently a side effect of fixing the distorted text displayed.

I think I've solved this, and have managed to get nicely formatted text displayed on my screen (left before, right after) by mashing up the existing draw_text_line code with a bit of James Lynch's wizardry.

So if you are having troubles with stretchy text like the above, give this a go and see if it works for you -

Code:
void NokiaLCD::draw_text_line(word fcolor, word bcolor, byte x, byte y, char c) {
word output0, output1;
lcd_set_box(x,y,x,y+8);
sendCMD(RAMWR);
for(unsigned int i=0;i<8;i++) {
// Create a bit mask, and apply it
if (1<<i & c) {
output0 = fcolor;
} else {
output0 = bcolor;
}
// Move the bit mask on, do the next pixel.
i++;
if (1<<i & c) {
output1 = fcolor;
} else {
output1 = bcolor;
}
sendData((output0 >> 4) & 0xFF);
sendData(((output0 & 0xF) << 4) | ((output1 >> 8) & 0xF));
sendData(output1 & 0xFF);
}
}

Now to sort out the contrast. Is black supposed to be blue?
Logged

Pages: [1]   Go Up
Jump to: