Ignore:
Timestamp:
Feb 1, 2019, 9:57:09 PM (5 years ago)
Author:
coas-nagasima
Message:

TINETとSocket APIなどを更新

Location:
asp3_tinet_ecnl_arm/trunk/ntshell/lcd
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • asp3_tinet_ecnl_arm/trunk/ntshell/lcd/draw_font.c

    r352 r364  
    11/*
    22 *  TOPPERS ECHONET Lite Communication Middleware
    3  * 
     3 *
    44 *  Copyright (C) 2018 Cores Co., Ltd. Japan
    5  * 
     5 *
    66 *  上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
    77 *  ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
     
    2626 *      由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
    2727 *      免責すること.
    28  * 
     28 *
    2929 *  本ソフトウェアは,無保証で提供されているものである.上記著作権者お
    3030 *  よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
     
    3232 *  アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
    3333 *  の責任を負わない.
    34  * 
     34 *
    3535 *  @(#) $Id$
    3636 */
     
    4141#include <string.h>
    4242#include <target_syssvc.h>
     43#ifndef ADAFRUIT_SSD1306
    4344#include "adafruit_st7735.h"
     45#else
     46#include "adafruit_ssd1306.h"
     47#endif
    4448#include "draw_font.h"
    45 #include "misaki_font.h"
    46 
    47 void get_bitmap_font(char *string, unsigned char *bitmap_data, unsigned long *use_chars)
    48 {
    49         unsigned long len, code;
    50         unsigned char i,j,k;
    51         unsigned long totalj, totalk;
     49
     50void get_bitmap_font(const uint8_t *string, uint8_t *bitmap_data, uint32_t *use_chars)
     51{
     52        uint32_t len, code;
     53        uint8_t i, j, k;
     54        uint32_t totalj, totalk;
    5255
    5356        *use_chars = 0;
    5457        len = 0;
    55         if      ((string[0] & 0x80) ==    0) { len = 1; }
     58        if ((string[0] & 0x80) == 0) { len = 1; }
    5659        else if ((string[0] & 0xE0) == 0xC0) { len = 2; }
    5760        else if ((string[0] & 0xF0) == 0xE0) { len = 3; }
    5861        else if ((string[0] & 0xF8) == 0xF0) { len = 4; }
    59         else { return;  }
     62        else { return; }
    6063
    6164        j = k = totalj = totalk = 0;
    6265
    63         if( len == 1 ) {
     66        if (len == 1) {
    6467                code = string[0];
    65                 memcpy(bitmap_data, &UTF8_1B_CODE_BITMAP[code][0], 8 );
     68                memcpy(bitmap_data, &UTF8_1B_CODE_BITMAP[code][0], FONT_WIDTH * FONT_HEIGHT / 8);
    6669                *use_chars = 1;
    6770                return;
    6871        }
    6972
    70         if( len == 2 ) {
     73        if (len == 2) {
    7174                code = string[0];
    7275                // 1バイト目サーチ
    73                 for(i = 0; i < UTF8_CODE_2B_1_NUM; i++ ) {
    74                         if ( Utf8CodeTable_2B_1st[i][0] == code ) {
     76                for (i = 0; i < UTF8_CODE_2B_1_NUM; i++) {
     77                        if (Utf8CodeTable_2B_1st[i][0] == code) {
    7578                                code = string[1];
    76                                 for( j = 0; j < Utf8CodeTable_2B_1st[i][1]; j++ ) {
    77                                         if ( UTF8_2B_CODE_BITMAP[totalk].code == code ) {
    78                                                 memcpy(bitmap_data, UTF8_2B_CODE_BITMAP[totalk].bitmap, 8 );
     79                                for (j = 0; j < Utf8CodeTable_2B_1st[i][1]; j++) {
     80                                        if (UTF8_2B_CODE_BITMAP[totalk].code == code) {
     81                                                memcpy(bitmap_data, UTF8_2B_CODE_BITMAP[totalk].bitmap, FONT_WIDTH * FONT_HEIGHT / 8);
    7982                                                *use_chars = 2;
    8083                                                return;
     
    9093        }
    9194
    92         if( len == 3 ) {
     95        if (len == 3) {
    9396                code = string[0];
    9497                // 1バイト目サーチ
    95                 for(i = 0; i < UTF8_CODE_3B_1_NUM; i++ ) {
    96                         if ( Utf8CodeTable_3B_1st[i][0] == code ) {
     98                for (i = 0; i < UTF8_CODE_3B_1_NUM; i++) {
     99                        if (Utf8CodeTable_3B_1st[i][0] == code) {
    97100                                code = string[1];
    98101                                // 2バイト目サーチ
    99                                 for( j = 0; j < Utf8CodeTable_3B_1st[i][1]; j++ ){
    100                                         if ( Utf8CodeTable_3B_2nd[totalj][0] == code ) {
     102                                for (j = 0; j < Utf8CodeTable_3B_1st[i][1]; j++) {
     103                                        if (Utf8CodeTable_3B_2nd[totalj][0] == code) {
    101104                                                code = string[2];
    102105                                                // 3バイト目サーチ
    103                                                 for( k = 0; k < Utf8CodeTable_3B_2nd[totalj][1]; k++) {
     106                                                for (k = 0; k < Utf8CodeTable_3B_2nd[totalj][1]; k++) {
    104107                                                        if (UTF8_3B_CODE_BITMAP[totalk].code == code) {
    105                                                                 memcpy(bitmap_data, UTF8_3B_CODE_BITMAP[totalk].bitmap, 8 );
     108                                                                memcpy(bitmap_data, UTF8_3B_CODE_BITMAP[totalk].bitmap, FONT_WIDTH * FONT_HEIGHT / 8);
    106109                                                                *use_chars = 3;
    107110                                                                return;
     
    111114                                                return;
    112115                                        }
    113                                         else{/*読み飛ばすbitmap個数を蓄積*/
     116                                        else {/*読み飛ばすbitmap個数を蓄積*/
    114117                                                totalk += Utf8CodeTable_3B_2nd[totalj][1];
    115118                                        }
     
    118121                        }
    119122                        else {/*読み飛ばすbitmap個数を蓄積*/
    120                                 for( j = 0; j < Utf8CodeTable_3B_1st[i][1]; j++ ) {
     123                                for (j = 0; j < Utf8CodeTable_3B_1st[i][1]; j++) {
    121124                                        totalk += Utf8CodeTable_3B_2nd[totalj][1];
    122125                                        totalj++;
     
    128131}
    129132
    130 void lcd_drawFont(LCD_Handler_t *hlcd, unsigned char *bitmap_data, int x, int y, unsigned short color, unsigned short back_color)
    131 {
    132         int i, j;
    133 
    134         for(i = 0; i < 8; i++ ) {
    135                 for(j = 0; j < 8; j++ ) {
    136                         if (((bitmap_data[i] >> j) & 0x01) == 1){
    137                                 lcd_drawPixel(hlcd, x - j, y + i, color);
     133void lcd_drawFont(LCD_Handler_t *hlcd, uint8_t *bitmap_data, int x, int y, uint16_t color, uint16_t back_color)
     134{
     135        int i, j, b;
     136        uint8_t *bitmap = bitmap_data;
     137
     138        b = 0x80;
     139        for (i = 0; i < FONT_HEIGHT; i++) {
     140                for (j = 0; j < FONT_WIDTH; j++) {
     141                        if ((*bitmap & b) != 0) {
     142                                lcd_drawPixel(hlcd, x + j, y + i, color);
    138143                        }
    139144                        else {
    140                                 lcd_drawPixel(hlcd, x - j, y + i, back_color);
    141                         }
    142                 }
    143         }
    144 }
    145 
    146 void lcd_drawFontHalf(LCD_Handler_t *hlcd, unsigned char *bitmap_data, int x, int y, unsigned short color, unsigned short back_color)
    147 {
    148         int i, j;
    149 
    150         for(i = 0; i < 8; i++ ) {
    151                 for(j = 4; j < 8; j++ ) {
    152                         if (((bitmap_data[i] >> j) & 0x01) == 1){
    153                                 lcd_drawPixel(hlcd, x - j, y + i, color);
     145                                lcd_drawPixel(hlcd, x + j, y + i, back_color);
     146                        }
     147                        b >>= 1;
     148                        if (b == 0) {
     149                                b = 0x80;
     150                                bitmap++;
     151                        }
     152                }
     153        }
     154}
     155
     156void lcd_drawFontHalf(LCD_Handler_t *hlcd, uint8_t *bitmap_data, int x, int y, uint16_t color, uint16_t back_color)
     157{
     158        int i, j, b;
     159        uint8_t *bitmap = bitmap_data;
     160
     161        b = 0x80;
     162        for (i = 0; i < FONT_HEIGHT; i++) {
     163                for (j = 0; j < FONT_HALF_WIDTH; j++) {
     164                        if ((*bitmap & b) != 0) {
     165                                lcd_drawPixel(hlcd, x + j, y + i, color);
    154166                        }
    155167                        else {
    156                                 lcd_drawPixel(hlcd, x - j, y + i, back_color);
    157                         }
    158                 }
    159         }
    160 }
    161 
    162 void lcd_drawString(LCD_Handler_t *hlcd, char *string, int x, int y, unsigned short color, unsigned short back_color )
    163 {
    164         unsigned long current_top, use_chars, for_3B_hankaku_code;
    165         unsigned char bitmap_data[8], ctrl_code;
    166         int local_x, local_y;
     168                                lcd_drawPixel(hlcd, x + j, y + i, back_color);
     169                        }
     170                        b >>= 1;
     171                        if (b == 0) {
     172                                b = 0x80;
     173                                bitmap++;
     174                        }
     175                }
     176        }
     177}
     178
     179void lcd_drawString(LCD_Handler_t *hlcd, const char *string, int x, int y, uint16_t color, uint16_t back_color)
     180{
     181        uint32_t current_top, use_chars, for_3B_hankaku_code;
     182        uint8_t bitmap_data[FONT_WIDTH * FONT_HEIGHT / 8], ctrl_code;
     183        int local_x, local_y, len = strlen(string);
     184        const uint8_t *code = (const uint8_t *)string;
    167185
    168186        local_x = x;
     
    170188
    171189        current_top = 0;
    172         while( current_top < strlen(string) )
    173         {
    174                 memset(bitmap_data,0x0,8);
    175                 ctrl_code = string[current_top];
    176                 get_bitmap_font(&string[current_top], bitmap_data, &use_chars);
    177                 if(use_chars == 0)
     190        while (current_top < len) {
     191                memset(bitmap_data, 0x0, FONT_WIDTH * FONT_HEIGHT / 8);
     192                ctrl_code = code[current_top];
     193                get_bitmap_font(&code[current_top], bitmap_data, &use_chars);
     194                if (use_chars == 0)
    178195                        return;
    179196
    180197                //3バイトコード半角文字用
    181                 if(use_chars == 3) {
     198                if (use_chars == 3) {
    182199                        for_3B_hankaku_code = 0;
    183                         for_3B_hankaku_code = ( (string[current_top]  << 16) |
    184                                                                     (string[current_top+1] << 8) |
    185                                                                     (string[current_top+2]      )   );
     200                        for_3B_hankaku_code = ((code[current_top] << 16) |
     201                                (code[current_top + 1] << 8) |
     202                                (code[current_top + 2]));
    186203                }
    187204
     
    189206
    190207                //1バイトコード半角文字
    191                 if ( use_chars == 1 ) {
    192                         if(ctrl_code == 0x0D) { // CR
     208                if (use_chars == 1) {
     209                        if (ctrl_code == 0x0D) { // CR
    193210                                local_x = X_LINE_TO_PIX(hlcd, 0);
    194211                                continue;
    195212                        }
    196                         if(ctrl_code == 0x0A) { // LF
    197                                 local_y = local_y + 8;
     213                        if (ctrl_code == 0x0A) { // LF
     214                                local_y = local_y + FONT_HEIGHT;
    198215                                continue;
    199216                        }
    200217
    201                         if ( local_x >= hlcd->_width + 4 ) {
     218                        if (local_x + FONT_HALF_WIDTH > hlcd->_width) {
    202219                                local_x = X_LINE_HALF_TO_PIX(hlcd, 0);
    203                                 local_y = local_y + 8;
     220                                local_y = local_y + FONT_HEIGHT;
    204221                        }
    205222                        lcd_drawFontHalf(hlcd, bitmap_data, local_x, local_y, color, back_color);
    206                         local_x += 4;
     223                        local_x += FONT_HALF_WIDTH;
    207224                        continue;
    208225                }
    209226
    210227                //3バイトコード半角文字
    211                 if( use_chars == 3 ) {
    212                         if (    ( (0xEFBDA1 <= for_3B_hankaku_code) && (for_3B_hankaku_code <= 0xEFBDBF) ) ||
    213                                         ( (0xEFBE80 <= for_3B_hankaku_code) && (for_3B_hankaku_code <= 0xEFBE9F) )      ) {
     228                if (use_chars == 3) {
     229                        if (((0xEFBDA1 <= for_3B_hankaku_code) && (for_3B_hankaku_code <= 0xEFBDBF)) ||
     230                                ((0xEFBE80 <= for_3B_hankaku_code) && (for_3B_hankaku_code <= 0xEFBE9F))) {
    214231                                //3バイトコード半角文字
    215                                 if ( local_x >= hlcd->_width + 4 ) {
     232                                if (local_x + FONT_HALF_WIDTH > hlcd->_width) {
    216233                                        local_x = X_LINE_HALF_TO_PIX(hlcd, 0);
    217                                         local_y = local_y + 8;
     234                                        local_y = local_y + FONT_HEIGHT;
    218235                                }
    219236                                lcd_drawFontHalf(hlcd, bitmap_data, local_x, local_y, color, back_color);
    220                                 local_x += 4;
     237                                local_x += FONT_HALF_WIDTH;
    221238                                continue;
    222239                        }
     
    224241
    225242                //全角文字
    226                 if ( local_x >= hlcd->_width + 8 ) {
     243                if (local_x + FONT_WIDTH > hlcd->_width) {
    227244                        local_x = X_LINE_TO_PIX(hlcd, 0);
    228                         local_y = local_y + 8;
     245                        local_y = local_y + FONT_HEIGHT;
    229246                }
    230247                lcd_drawFont(hlcd, bitmap_data, local_x, local_y, color, back_color);
    231                 local_x += 8;
    232         }
    233 }
    234 
     248                local_x += FONT_WIDTH;
     249        }
     250}
     251
  • asp3_tinet_ecnl_arm/trunk/ntshell/lcd/draw_font.h

    r352 r364  
    3939#define DRAW_FONT_H
    4040
     41#if defined(SHNM16_FONT)
     42#include "shnm16_font.h"
     43#elif defined(SHNM12_FONT)
     44#include "shnm12_font.h"
     45#else
     46#include "misaki_font.h"
     47#endif
     48
    4149#define DISP_X_ADJ      0
    4250#define DISP_Y_ADJ      0
    43 #define X_ZENKAKU_CHARACTERS(hlcd)      ((hlcd)->_width / 8)
    44 #define X_HANKAKU_CHARACTERS(hlcd)      ((hlcd)->_width / 4)
    45 #define Y_CHARACTERS(hlcd)                      ((hlcd)->_height / 8)
    46 #define X_LINE_TO_PIX(hlcd, x)          ((8*(x))-DISP_X_ADJ)
    47 #define X_LINE_HALF_TO_PIX(hlcd, x)     ((4*(x))-DISP_X_ADJ)
    48 #define Y_ROW_TO_PIX(hlcd, y)           ((8*(y))-DISP_Y_ADJ)
     51#define X_ZENKAKU_CHARACTERS(hlcd)      ((hlcd)->_width / FONT_WIDTH)
     52#define X_HANKAKU_CHARACTERS(hlcd)      ((hlcd)->_width / FONT_HALF_WIDTH)
     53#define Y_CHARACTERS(hlcd)                      ((hlcd)->_height / FONT_HEIGHT)
     54#define X_LINE_TO_PIX(hlcd, x)          ((FONT_WIDTH*(x))-DISP_X_ADJ)
     55#define X_LINE_HALF_TO_PIX(hlcd, x)     ((FONT_HALF_WIDTH*(x))-DISP_X_ADJ)
     56#define Y_ROW_TO_PIX(hlcd, y)           ((FONT_HEIGHT*(y))-DISP_Y_ADJ)
    4957
    5058#ifdef __cplusplus
     
    5260#endif
    5361
    54 void get_bitmap_font(char *string, unsigned char *bitmap_data, unsigned long *use_chars);
    55 void lcd_drawFont(LCD_Handler_t *hlcd, unsigned char *bitmap_data, int x, int y, unsigned short color, unsigned short back_color);
    56 void lcd_drawFontHalf(LCD_Handler_t *hlcd, unsigned char *bitmap_data, int x, int y, unsigned short color, unsigned short back_color);
    57 void lcd_drawString(LCD_Handler_t *hlcd, char *string, int x, int y, unsigned short color, unsigned short back_color );
     62void get_bitmap_font(const uint8_t *string, uint8_t *bitmap_data, uint32_t *use_chars);
     63void lcd_drawFont(LCD_Handler_t *hlcd, uint8_t *bitmap_data, int x, int y, uint16_t color, uint16_t back_color);
     64void lcd_drawFontHalf(LCD_Handler_t *hlcd, uint8_t *bitmap_data, int x, int y, uint16_t color, uint16_t back_color);
     65void lcd_drawString(LCD_Handler_t *hlcd, const char *string, int x, int y, uint16_t color, uint16_t back_color );
    5866
    5967#ifdef __cplusplus
  • asp3_tinet_ecnl_arm/trunk/ntshell/lcd/misaki_font.c

    r352 r364  
    4646
    4747// 1バイトコード
    48 unsigned char UTF8_1B_CODE_BITMAP[UTF8_1B_CODE_BITMAP_NUM][8] = {
    49         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    50         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    51         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    52         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    53         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    54         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    55         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    56         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    57         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    58         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    59         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    60         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    61         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    62         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    63         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    64         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    65         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    66         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    67         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    68         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    69         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    70         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    71         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    72         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    73         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    74         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    75         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    76         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    77         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    78         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    79         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    80         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    81         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    82         {0x40, 0x40, 0x40, 0x40, 0x00, 0x40, 0x00, 0x00},
    83         {0xA0, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    84         {0xA0, 0xE0, 0xA0, 0xA0, 0xE0, 0xA0, 0x00, 0x00},
    85         {0x40, 0xE0, 0xC0, 0x60, 0xE0, 0x40, 0x00, 0x00},
    86         {0x00, 0x80, 0x20, 0x40, 0x80, 0x20, 0x00, 0x00},
    87         {0x40, 0xA0, 0x40, 0x60, 0xC0, 0xE0, 0x00, 0x00},
    88         {0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    89         {0x20, 0x40, 0x40, 0x40, 0x40, 0x40, 0x20, 0x00},
    90         {0x80, 0x40, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00},
    91         {0x40, 0xE0, 0x40, 0xA0, 0x00, 0x00, 0x00, 0x00},
    92         {0x00, 0x40, 0x40, 0xE0, 0x40, 0x40, 0x00, 0x00},
    93         {0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x00},
    94         {0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00},
    95         {0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00},
    96         {0x00, 0x00, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00},
    97         {0x00, 0x40, 0xA0, 0xE0, 0xA0, 0x40, 0x00, 0x00},
    98         {0x00, 0x40, 0xC0, 0x40, 0x40, 0xE0, 0x00, 0x00},
    99         {0x00, 0xC0, 0x20, 0x40, 0x80, 0xE0, 0x00, 0x00},
    100         {0x00, 0xC0, 0x20, 0x40, 0x20, 0xC0, 0x00, 0x00},
    101         {0x00, 0x20, 0x60, 0xA0, 0xE0, 0x20, 0x00, 0x00},
    102         {0x00, 0xE0, 0x80, 0xC0, 0x20, 0xC0, 0x00, 0x00},
    103         {0x00, 0x60, 0x80, 0xC0, 0xA0, 0x40, 0x00, 0x00},
    104         {0x00, 0xE0, 0x20, 0x40, 0x40, 0x40, 0x00, 0x00},
    105         {0x00, 0x40, 0xA0, 0x40, 0xA0, 0x40, 0x00, 0x00},
    106         {0x00, 0x40, 0xA0, 0x60, 0x20, 0xC0, 0x00, 0x00},
    107         {0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00},
    108         {0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x80, 0x00},
    109         {0x00, 0x20, 0x40, 0x80, 0x40, 0x20, 0x00, 0x00},
    110         {0x00, 0x00, 0xE0, 0x00, 0xE0, 0x00, 0x00, 0x00},
    111         {0x00, 0x80, 0x40, 0x20, 0x40, 0x80, 0x00, 0x00},
    112         {0x40, 0xA0, 0x20, 0x40, 0x00, 0x40, 0x00, 0x00},
    113         {0x40, 0xA0, 0x20, 0x60, 0xA0, 0x40, 0x00, 0x00},
    114         {0x40, 0xA0, 0xA0, 0xE0, 0xA0, 0xA0, 0x00, 0x00},
    115         {0xC0, 0xA0, 0xC0, 0xA0, 0xA0, 0xC0, 0x00, 0x00},
    116         {0x60, 0x80, 0x80, 0x80, 0x80, 0x60, 0x00, 0x00},
    117         {0xC0, 0xA0, 0xA0, 0xA0, 0xA0, 0xC0, 0x00, 0x00},
    118         {0xE0, 0x80, 0xC0, 0x80, 0x80, 0xE0, 0x00, 0x00},
    119         {0xE0, 0x80, 0xC0, 0x80, 0x80, 0x80, 0x00, 0x00},
    120         {0x60, 0x80, 0x80, 0xA0, 0xA0, 0x60, 0x00, 0x00},
    121         {0xA0, 0xA0, 0xA0, 0xE0, 0xA0, 0xA0, 0x00, 0x00},
    122         {0xE0, 0x40, 0x40, 0x40, 0x40, 0xE0, 0x00, 0x00},
    123         {0x20, 0x20, 0x20, 0x20, 0xA0, 0x40, 0x00, 0x00},
    124         {0xA0, 0xA0, 0xC0, 0xA0, 0xA0, 0xA0, 0x00, 0x00},
    125         {0x80, 0x80, 0x80, 0x80, 0x80, 0xE0, 0x00, 0x00},
    126         {0xA0, 0xE0, 0xE0, 0xA0, 0xA0, 0xA0, 0x00, 0x00},
    127         {0xC0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0x00, 0x00},
    128         {0x40, 0xA0, 0xA0, 0xA0, 0xA0, 0x40, 0x00, 0x00},
    129         {0xC0, 0xA0, 0xA0, 0xC0, 0x80, 0x80, 0x00, 0x00},
    130         {0x40, 0xA0, 0xA0, 0xA0, 0xA0, 0x40, 0x20, 0x00},
    131         {0xC0, 0xA0, 0xA0, 0xC0, 0xA0, 0xA0, 0x00, 0x00},
    132         {0x60, 0x80, 0x40, 0x20, 0x20, 0xC0, 0x00, 0x00},
    133         {0xE0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00},
    134         {0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xE0, 0x00, 0x00},
    135         {0xA0, 0xA0, 0xA0, 0xA0, 0xC0, 0x80, 0x00, 0x00},
    136         {0xA0, 0xA0, 0xA0, 0xE0, 0xE0, 0xA0, 0x00, 0x00},
    137         {0xA0, 0xA0, 0x40, 0x40, 0xA0, 0xA0, 0x00, 0x00},
    138         {0xA0, 0xA0, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00},
    139         {0xE0, 0x20, 0x40, 0x40, 0x80, 0xE0, 0x00, 0x00},
    140         {0x60, 0x40, 0x40, 0x40, 0x40, 0x40, 0x60, 0x00},
    141         {0xA0, 0x40, 0xE0, 0x40, 0xE0, 0x40, 0x00, 0x00},
    142         {0xC0, 0x40, 0x40, 0x40, 0x40, 0x40, 0xC0, 0x00},
    143         {0x40, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    144         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00},
    145         {0x40, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    146         {0x00, 0x00, 0x60, 0xA0, 0xA0, 0x60, 0x00, 0x00},
    147         {0x80, 0x80, 0xC0, 0xA0, 0xA0, 0xC0, 0x00, 0x00},
    148         {0x00, 0x00, 0x60, 0x80, 0x80, 0x60, 0x00, 0x00},
    149         {0x20, 0x20, 0x60, 0xA0, 0xA0, 0x60, 0x00, 0x00},
    150         {0x00, 0x00, 0x60, 0xE0, 0x80, 0x60, 0x00, 0x00},
    151         {0x60, 0x40, 0xE0, 0x40, 0x40, 0x40, 0x00, 0x00},
    152         {0x00, 0x00, 0x60, 0xA0, 0x60, 0x20, 0xC0, 0x00},
    153         {0x80, 0x80, 0xC0, 0xA0, 0xA0, 0xA0, 0x00, 0x00},
    154         {0x40, 0x00, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00},
    155         {0x40, 0x00, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00},
    156         {0x80, 0x80, 0xA0, 0xC0, 0xA0, 0xA0, 0x00, 0x00},
    157         {0xC0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00},
    158         {0x00, 0x00, 0xC0, 0xE0, 0xE0, 0xA0, 0x00, 0x00},
    159         {0x00, 0x00, 0xC0, 0xA0, 0xA0, 0xA0, 0x00, 0x00},
    160         {0x00, 0x00, 0x40, 0xA0, 0xA0, 0x40, 0x00, 0x00},
    161         {0x00, 0x00, 0xC0, 0xA0, 0xA0, 0xC0, 0x80, 0x00},
    162         {0x00, 0x00, 0x60, 0xA0, 0xA0, 0x60, 0x20, 0x00},
    163         {0x00, 0x00, 0xA0, 0xC0, 0x80, 0x80, 0x00, 0x00},
    164         {0x00, 0x00, 0x60, 0xC0, 0x60, 0xC0, 0x00, 0x00},
    165         {0x00, 0x40, 0xE0, 0x40, 0x40, 0x60, 0x00, 0x00},
    166         {0x00, 0x00, 0xA0, 0xA0, 0xA0, 0xE0, 0x00, 0x00},
    167         {0x00, 0x00, 0xA0, 0xA0, 0xC0, 0x80, 0x00, 0x00},
    168         {0x00, 0x00, 0xA0, 0xA0, 0xE0, 0xE0, 0x00, 0x00},
    169         {0x00, 0x00, 0xA0, 0x40, 0x40, 0xA0, 0x00, 0x00},
    170         {0x00, 0x00, 0xA0, 0xA0, 0x60, 0x20, 0xC0, 0x00},
    171         {0x00, 0x00, 0xE0, 0x20, 0x40, 0xE0, 0x00, 0x00},
    172         {0x20, 0x40, 0x40, 0x80, 0x40, 0x40, 0x20, 0x00},
    173         {0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00},
    174         {0x80, 0x40, 0x40, 0x20, 0x40, 0x40, 0x80, 0x00},
    175         {0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    176         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
     48const uint8_t UTF8_1B_CODE_BITMAP[UTF8_1B_CODE_BITMAP_NUM][FONT_HALF_WIDTH * FONT_HEIGHT / 8] = {
     49        {0x00, 0x00, 0x00, 0x00},
     50        {0x00, 0x00, 0x00, 0x00},
     51        {0x00, 0x00, 0x00, 0x00},
     52        {0x00, 0x00, 0x00, 0x00},
     53        {0x00, 0x00, 0x00, 0x00},
     54        {0x00, 0x00, 0x00, 0x00},
     55        {0x00, 0x00, 0x00, 0x00},
     56        {0x00, 0x00, 0x00, 0x00},
     57        {0x00, 0x00, 0x00, 0x00},
     58        {0x00, 0x00, 0x00, 0x00},
     59        {0x00, 0x00, 0x00, 0x00},
     60        {0x00, 0x00, 0x00, 0x00},
     61        {0x00, 0x00, 0x00, 0x00},
     62        {0x00, 0x00, 0x00, 0x00},
     63        {0x00, 0x00, 0x00, 0x00},
     64        {0x00, 0x00, 0x00, 0x00},
     65        {0x00, 0x00, 0x00, 0x00},
     66        {0x00, 0x00, 0x00, 0x00},
     67        {0x00, 0x00, 0x00, 0x00},
     68        {0x00, 0x00, 0x00, 0x00},
     69        {0x00, 0x00, 0x00, 0x00},
     70        {0x00, 0x00, 0x00, 0x00},
     71        {0x00, 0x00, 0x00, 0x00},
     72        {0x00, 0x00, 0x00, 0x00},
     73        {0x00, 0x00, 0x00, 0x00},
     74        {0x00, 0x00, 0x00, 0x00},
     75        {0x00, 0x00, 0x00, 0x00},
     76        {0x00, 0x00, 0x00, 0x00},
     77        {0x00, 0x00, 0x00, 0x00},
     78        {0x00, 0x00, 0x00, 0x00},
     79        {0x00, 0x00, 0x00, 0x00},
     80        {0x00, 0x00, 0x00, 0x00},
     81        {0x00, 0x00, 0x00, 0x00},
     82        {0x44, 0x44, 0x04, 0x00},
     83        {0xAA, 0x00, 0x00, 0x00},
     84        {0xAE, 0xAA, 0xEA, 0x00},
     85        {0x4E, 0xC6, 0xE4, 0x00},
     86        {0x08, 0x24, 0x82, 0x00},
     87        {0x4A, 0x46, 0xCE, 0x00},
     88        {0x48, 0x00, 0x00, 0x00},
     89        {0x24, 0x44, 0x44, 0x20},
     90        {0x84, 0x44, 0x44, 0x80},
     91        {0x4E, 0x4A, 0x00, 0x00},
     92        {0x04, 0x4E, 0x44, 0x00},
     93        {0x00, 0x00, 0x04, 0x80},
     94        {0x00, 0x0E, 0x00, 0x00},
     95        {0x00, 0x00, 0x04, 0x00},
     96        {0x00, 0x24, 0x80, 0x00},
     97        {0x04, 0xAE, 0xA4, 0x00},
     98        {0x04, 0xC4, 0x4E, 0x00},
     99        {0x0C, 0x24, 0x8E, 0x00},
     100        {0x0C, 0x24, 0x2C, 0x00},
     101        {0x02, 0x6A, 0xE2, 0x00},
     102        {0x0E, 0x8C, 0x2C, 0x00},
     103        {0x06, 0x8C, 0xA4, 0x00},
     104        {0x0E, 0x24, 0x44, 0x00},
     105        {0x04, 0xA4, 0xA4, 0x00},
     106        {0x04, 0xA6, 0x2C, 0x00},
     107        {0x00, 0x40, 0x04, 0x00},
     108        {0x00, 0x40, 0x04, 0x80},
     109        {0x02, 0x48, 0x42, 0x00},
     110        {0x00, 0xE0, 0xE0, 0x00},
     111        {0x08, 0x42, 0x48, 0x00},
     112        {0x4A, 0x24, 0x04, 0x00},
     113        {0x4A, 0x26, 0xA4, 0x00},
     114        {0x4A, 0xAE, 0xAA, 0x00},
     115        {0xCA, 0xCA, 0xAC, 0x00},
     116        {0x68, 0x88, 0x86, 0x00},
     117        {0xCA, 0xAA, 0xAC, 0x00},
     118        {0xE8, 0xC8, 0x8E, 0x00},
     119        {0xE8, 0xC8, 0x88, 0x00},
     120        {0x68, 0x8A, 0xA6, 0x00},
     121        {0xAA, 0xAE, 0xAA, 0x00},
     122        {0xE4, 0x44, 0x4E, 0x00},
     123        {0x22, 0x22, 0xA4, 0x00},
     124        {0xAA, 0xCA, 0xAA, 0x00},
     125        {0x88, 0x88, 0x8E, 0x00},
     126        {0xAE, 0xEA, 0xAA, 0x00},
     127        {0xCA, 0xAA, 0xAA, 0x00},
     128        {0x4A, 0xAA, 0xA4, 0x00},
     129        {0xCA, 0xAC, 0x88, 0x00},
     130        {0x4A, 0xAA, 0xA4, 0x20},
     131        {0xCA, 0xAC, 0xAA, 0x00},
     132        {0x68, 0x42, 0x2C, 0x00},
     133        {0xE4, 0x44, 0x44, 0x00},
     134        {0xAA, 0xAA, 0xAE, 0x00},
     135        {0xAA, 0xAA, 0xC8, 0x00},
     136        {0xAA, 0xAE, 0xEA, 0x00},
     137        {0xAA, 0x44, 0xAA, 0x00},
     138        {0xAA, 0x44, 0x44, 0x00},
     139        {0xE2, 0x44, 0x8E, 0x00},
     140        {0x64, 0x44, 0x44, 0x60},
     141        {0xA4, 0xE4, 0xE4, 0x00},
     142        {0xC4, 0x44, 0x44, 0xC0},
     143        {0x4A, 0x00, 0x00, 0x00},
     144        {0x00, 0x00, 0x00, 0xE0},
     145        {0x42, 0x00, 0x00, 0x00},
     146        {0x00, 0x6A, 0xA6, 0x00},
     147        {0x88, 0xCA, 0xAC, 0x00},
     148        {0x00, 0x68, 0x86, 0x00},
     149        {0x22, 0x6A, 0xA6, 0x00},
     150        {0x00, 0x6E, 0x86, 0x00},
     151        {0x64, 0xE4, 0x44, 0x00},
     152        {0x00, 0x6A, 0x62, 0xC0},
     153        {0x88, 0xCA, 0xAA, 0x00},
     154        {0x40, 0x44, 0x44, 0x00},
     155        {0x40, 0x44, 0x44, 0x80},
     156        {0x88, 0xAC, 0xAA, 0x00},
     157        {0xC4, 0x44, 0x44, 0x00},
     158        {0x00, 0xCE, 0xEA, 0x00},
     159        {0x00, 0xCA, 0xAA, 0x00},
     160        {0x00, 0x4A, 0xA4, 0x00},
     161        {0x00, 0xCA, 0xAC, 0x80},
     162        {0x00, 0x6A, 0xA6, 0x20},
     163        {0x00, 0xAC, 0x88, 0x00},
     164        {0x00, 0x6C, 0x6C, 0x00},
     165        {0x04, 0xE4, 0x46, 0x00},
     166        {0x00, 0xAA, 0xAE, 0x00},
     167        {0x00, 0xAA, 0xC8, 0x00},
     168        {0x00, 0xAA, 0xEE, 0x00},
     169        {0x00, 0xA4, 0x4A, 0x00},
     170        {0x00, 0xAA, 0x62, 0xC0},
     171        {0x00, 0xE2, 0x4E, 0x00},
     172        {0x24, 0x48, 0x44, 0x20},
     173        {0x44, 0x44, 0x44, 0x40},
     174        {0x84, 0x42, 0x44, 0x80},
     175        {0xE0, 0x00, 0x00, 0x00},
     176        {0x00, 0x00, 0x00, 0x00}
    177177};
    178178
    179179// 2バイトコード 1バイト目
    180 unsigned char Utf8CodeTable_2B_1st[UTF8_CODE_2B_1_NUM][2] = {
     180const uint8_t Utf8CodeTable_2B_1st[UTF8_CODE_2B_1_NUM][2] = {
    181181        {0xC2,  0x06},
    182182        {0xC3,  0x02},
     
    187187};
    188188// 2バイトコード 2バイト目 bitmapデータ
    189 struct utf8_code_bitmap UTF8_2B_CODE_BITMAP[UTF8_2B_CODE_BITMAP_NUM] = {
     189const struct utf8_code_bitmap UTF8_2B_CODE_BITMAP[UTF8_2B_CODE_BITMAP_NUM] = {
    190190        {0xA7,  {0x1C, 0x20, 0x18, 0x24, 0x18, 0x04, 0x38, 0x00}},
    191191        {0xA8,  {0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}},
     
    313313
    314314// 3バイトコード 1バイト目
    315 unsigned char Utf8CodeTable_3B_1st[UTF8_CODE_3B_1_NUM][2] = {
     315const uint8_t Utf8CodeTable_3B_1st[UTF8_CODE_3B_1_NUM][2] = {
    316316        {0xE2,  0x0E},
    317317        {0xE3,  0x04},
     
    325325};
    326326// 3バイトコード 2バイト目
    327 unsigned char Utf8CodeTable_3B_2nd[UTF8_CODE_3B_2_NUM][2] = {
     327const uint8_t Utf8CodeTable_3B_2nd[UTF8_CODE_3B_2_NUM][2] = {
    328328        {0x80,  0x0F},
    329329        {0x84,  0x02},
     
    673673
    674674// 3バイトコード 3バイト目 bitmapデータ
    675 struct utf8_code_bitmap UTF8_3B_CODE_BITMAP[UTF8_3B_CODE_BITMAP_NUM] = {
     675const struct utf8_code_bitmap UTF8_3B_CODE_BITMAP[UTF8_3B_CODE_BITMAP_NUM] = {
    676676        { 0x90 ,{0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00}},
    677677        { 0x95 ,{0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00}},
  • asp3_tinet_ecnl_arm/trunk/ntshell/lcd/misaki_font.h

    r352 r364  
    3939#define MISAKI_FONT_H
    4040
     41#include <stdint.h>
     42
     43#define FONT_HALF_WIDTH                 4
     44#define FONT_WIDTH                              8
     45#define FONT_HEIGHT                             8
     46
    4147struct utf8_code_bitmap {
    42         unsigned char code;
    43         unsigned char bitmap[8];
     48        const uint8_t code;
     49        const uint8_t bitmap[FONT_WIDTH * FONT_HEIGHT / 8];
    4450};
    4551
     
    4854#define UTF8_CODE_3B_2_NUM              (343+1)         /*半角追加2/2*/
    4955
    50 #define UTF8_CODE_BITMAP_NUM    6879                                                                                            /*トータル*/
    5156#define UTF8_1B_CODE_BITMAP_NUM 128
    5257#define UTF8_2B_CODE_BITMAP_NUM 122                                                                                                     /*"¬","\","¢""£"移動)*/
     
    5459
    5560// 1バイトコード
    56 extern unsigned char UTF8_1B_CODE_BITMAP[UTF8_1B_CODE_BITMAP_NUM][8];
     61extern const uint8_t UTF8_1B_CODE_BITMAP[UTF8_1B_CODE_BITMAP_NUM][FONT_HALF_WIDTH * FONT_HEIGHT / 8];
    5762
    5863// 2バイトコード 1バイト目
    59 extern unsigned char Utf8CodeTable_2B_1st[UTF8_CODE_2B_1_NUM][2];
     64extern const uint8_t Utf8CodeTable_2B_1st[UTF8_CODE_2B_1_NUM][2];
    6065// 2バイトコード 2バイト目 bitmapデータ
    61 extern struct utf8_code_bitmap UTF8_2B_CODE_BITMAP[UTF8_2B_CODE_BITMAP_NUM];
     66extern const struct utf8_code_bitmap UTF8_2B_CODE_BITMAP[UTF8_2B_CODE_BITMAP_NUM];
    6267
    6368// 3バイトコード 1バイト目
    64 extern unsigned char Utf8CodeTable_3B_1st[UTF8_CODE_3B_1_NUM][2];
     69extern const uint8_t Utf8CodeTable_3B_1st[UTF8_CODE_3B_1_NUM][2];
    6570// 3バイトコード 2バイト目
    66 extern unsigned char Utf8CodeTable_3B_2nd[UTF8_CODE_3B_2_NUM][2];
     71extern const uint8_t Utf8CodeTable_3B_2nd[UTF8_CODE_3B_2_NUM][2];
    6772
    6873// 3バイトコード 3バイト目 bitmapデータ
    69 extern struct utf8_code_bitmap UTF8_3B_CODE_BITMAP[UTF8_3B_CODE_BITMAP_NUM];
     74extern const struct utf8_code_bitmap UTF8_3B_CODE_BITMAP[UTF8_3B_CODE_BITMAP_NUM];
    7075
    7176#endif /* MISAKI_FONT_H */
Note: See TracChangeset for help on using the changeset viewer.