Drawing test for Japanese UTF-8 string literal using GT20L16J1Y font ROM.
Dependencies: C12832 GT20L16J1Y_font mbed
Fork of hello_GT20L16J1Y_FONT by
Diff: main.cpp
- Revision:
- 0:b468ef973095
- Child:
- 3:722665b5efc7
diff -r 000000000000 -r b468ef973095 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Jan 14 07:40:10 2014 +0000 @@ -0,0 +1,50 @@ +#include "mbed.h" +#include "C12832_lcd.h" +#include "GT20L16J1Y_font.h" + +/* + GT20L16J1Y library test program + works with mbed application board +*/ + +C12832_LCD lcd; +GT20L16J1Y_FONT font(p11, p12, p13, p10); + +void draw_kanji(int offset_x, int offset_y) +{ + int color; + for(int x=0; x<32; x++) + { + for(int y=0; y<8; y++) + { + if (font.bitmap[x] & (1<<y)) + color = 1; + else + color = 0; + lcd.pixel(x%16 + offset_x, y+(8*(x>>4)) + offset_y, color); + } + } + lcd.copy_to_lcd(); +} + +int main() +{ + unsigned short kbuf[16] = { + 0x9069, + 0x92BB, + 0x82C7, + 0x82A4, + 0x82C5, + 0x82B7, + 0x82A9, + 0x8148 + }; + + lcd.cls(); + + for(int i=0; i<8; i++) { + font.read(kbuf[i]); + draw_kanji(16*i, 0); + } + +}