Drawing test for Japanese UTF-8 string literal using GT20L16J1Y font ROM.

Dependencies:   C12832 GT20L16J1Y_font mbed

Fork of hello_GT20L16J1Y_FONT by Toyomasa Watarai

/media/uploads/MACRUM/10441061_10202364303981428_7731757494769382505_n.jpg

main.cpp

Committer:
MACRUM
Date:
2014-01-14
Revision:
0:b468ef973095
Child:
3:722665b5efc7

File content as of revision 0:b468ef973095:

#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);
    }
    
}