Changeset 364 for asp3_tinet_ecnl_arm/trunk/ntshell/lcd
- Timestamp:
- Feb 1, 2019, 9:57:09 PM (5 years ago)
- 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 1 1 /* 2 2 * TOPPERS ECHONET Lite Communication Middleware 3 * 3 * 4 4 * Copyright (C) 2018 Cores Co., Ltd. Japan 5 * 5 * 6 6 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 7 7 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 … … 26 26 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 27 27 * 免責すること. 28 * 28 * 29 29 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 30 30 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 … … 32 32 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 33 33 * の責任を負わない. 34 * 34 * 35 35 * @(#) $Id$ 36 36 */ … … 41 41 #include <string.h> 42 42 #include <target_syssvc.h> 43 #ifndef ADAFRUIT_SSD1306 43 44 #include "adafruit_st7735.h" 45 #else 46 #include "adafruit_ssd1306.h" 47 #endif 44 48 #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 50 void 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; 52 55 53 56 *use_chars = 0; 54 57 len = 0; 55 if ((string[0] & 0x80) ==0) { len = 1; }58 if ((string[0] & 0x80) == 0) { len = 1; } 56 59 else if ((string[0] & 0xE0) == 0xC0) { len = 2; } 57 60 else if ((string[0] & 0xF0) == 0xE0) { len = 3; } 58 61 else if ((string[0] & 0xF8) == 0xF0) { len = 4; } 59 else { return; 62 else { return; } 60 63 61 64 j = k = totalj = totalk = 0; 62 65 63 if ( len == 1) {66 if (len == 1) { 64 67 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); 66 69 *use_chars = 1; 67 70 return; 68 71 } 69 72 70 if ( len == 2) {73 if (len == 2) { 71 74 code = string[0]; 72 75 // 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) { 75 78 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); 79 82 *use_chars = 2; 80 83 return; … … 90 93 } 91 94 92 if ( len == 3) {95 if (len == 3) { 93 96 code = string[0]; 94 97 // 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) { 97 100 code = string[1]; 98 101 // 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) { 101 104 code = string[2]; 102 105 // 3バイト目サーチ 103 for (k = 0; k < Utf8CodeTable_3B_2nd[totalj][1]; k++) {106 for (k = 0; k < Utf8CodeTable_3B_2nd[totalj][1]; k++) { 104 107 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); 106 109 *use_chars = 3; 107 110 return; … … 111 114 return; 112 115 } 113 else {/*読み飛ばすbitmap個数を蓄積*/116 else {/*読み飛ばすbitmap個数を蓄積*/ 114 117 totalk += Utf8CodeTable_3B_2nd[totalj][1]; 115 118 } … … 118 121 } 119 122 else {/*読み飛ばすbitmap個数を蓄積*/ 120 for ( j = 0; j < Utf8CodeTable_3B_1st[i][1]; j++) {123 for (j = 0; j < Utf8CodeTable_3B_1st[i][1]; j++) { 121 124 totalk += Utf8CodeTable_3B_2nd[totalj][1]; 122 125 totalj++; … … 128 131 } 129 132 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); 133 void 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); 138 143 } 139 144 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 156 void 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); 154 166 } 155 167 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 179 void 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; 167 185 168 186 local_x = x; … … 170 188 171 189 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) 178 195 return; 179 196 180 197 //3バイトコード半角文字用 181 if (use_chars == 3) {198 if (use_chars == 3) { 182 199 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])); 186 203 } 187 204 … … 189 206 190 207 //1バイトコード半角文字 191 if ( use_chars == 1) {192 if (ctrl_code == 0x0D) { // CR208 if (use_chars == 1) { 209 if (ctrl_code == 0x0D) { // CR 193 210 local_x = X_LINE_TO_PIX(hlcd, 0); 194 211 continue; 195 212 } 196 if (ctrl_code == 0x0A) { // LF197 local_y = local_y + 8;213 if (ctrl_code == 0x0A) { // LF 214 local_y = local_y + FONT_HEIGHT; 198 215 continue; 199 216 } 200 217 201 if ( local_x >= hlcd->_width + 4) {218 if (local_x + FONT_HALF_WIDTH > hlcd->_width) { 202 219 local_x = X_LINE_HALF_TO_PIX(hlcd, 0); 203 local_y = local_y + 8;220 local_y = local_y + FONT_HEIGHT; 204 221 } 205 222 lcd_drawFontHalf(hlcd, bitmap_data, local_x, local_y, color, back_color); 206 local_x += 4;223 local_x += FONT_HALF_WIDTH; 207 224 continue; 208 225 } 209 226 210 227 //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))) { 214 231 //3バイトコード半角文字 215 if ( local_x >= hlcd->_width + 4) {232 if (local_x + FONT_HALF_WIDTH > hlcd->_width) { 216 233 local_x = X_LINE_HALF_TO_PIX(hlcd, 0); 217 local_y = local_y + 8;234 local_y = local_y + FONT_HEIGHT; 218 235 } 219 236 lcd_drawFontHalf(hlcd, bitmap_data, local_x, local_y, color, back_color); 220 local_x += 4;237 local_x += FONT_HALF_WIDTH; 221 238 continue; 222 239 } … … 224 241 225 242 //全角文字 226 if ( local_x >= hlcd->_width + 8) {243 if (local_x + FONT_WIDTH > hlcd->_width) { 227 244 local_x = X_LINE_TO_PIX(hlcd, 0); 228 local_y = local_y + 8;245 local_y = local_y + FONT_HEIGHT; 229 246 } 230 247 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 39 39 #define DRAW_FONT_H 40 40 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 41 49 #define DISP_X_ADJ 0 42 50 #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) 49 57 50 58 #ifdef __cplusplus … … 52 60 #endif 53 61 54 void get_bitmap_font(c har *string, unsigned char *bitmap_data, unsigned long*use_chars);55 void lcd_drawFont(LCD_Handler_t *hlcd, u nsigned char *bitmap_data, int x, int y, unsigned short color, unsigned short back_color);56 void lcd_drawFontHalf(LCD_Handler_t *hlcd, u nsigned char *bitmap_data, int x, int y, unsigned short color, unsigned short back_color);57 void lcd_drawString(LCD_Handler_t *hlcd, c har *string, int x, int y, unsigned short color, unsigned short back_color );62 void get_bitmap_font(const uint8_t *string, uint8_t *bitmap_data, uint32_t *use_chars); 63 void lcd_drawFont(LCD_Handler_t *hlcd, uint8_t *bitmap_data, int x, int y, uint16_t color, uint16_t back_color); 64 void lcd_drawFontHalf(LCD_Handler_t *hlcd, uint8_t *bitmap_data, int x, int y, uint16_t color, uint16_t back_color); 65 void lcd_drawString(LCD_Handler_t *hlcd, const char *string, int x, int y, uint16_t color, uint16_t back_color ); 58 66 59 67 #ifdef __cplusplus -
asp3_tinet_ecnl_arm/trunk/ntshell/lcd/misaki_font.c
r352 r364 46 46 47 47 // 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 {0x4 0, 0x40, 0x40, 0x40, 0x00, 0x40, 0x00, 0x00},83 {0xA 0, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},84 {0xA 0, 0xE0, 0xA0, 0xA0, 0xE0, 0xA0, 0x00, 0x00},85 {0x4 0, 0xE0, 0xC0, 0x60, 0xE0, 0x40, 0x00, 0x00},86 {0x0 0, 0x80, 0x20, 0x40, 0x80, 0x20, 0x00, 0x00},87 {0x4 0, 0xA0, 0x40, 0x60, 0xC0, 0xE0, 0x00, 0x00},88 {0x4 0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},89 {0x2 0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x20, 0x00},90 {0x8 0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00},91 {0x4 0, 0xE0, 0x40, 0xA0, 0x00, 0x00, 0x00, 0x00},92 {0x0 0, 0x40, 0x40, 0xE0, 0x40, 0x40, 0x00, 0x00},93 {0x00, 0x00, 0x0 0, 0x00, 0x00, 0x40, 0x80, 0x00},94 {0x00, 0x0 0, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00},95 {0x00, 0x00, 0x0 0, 0x00, 0x00, 0x40, 0x00, 0x00},96 {0x00, 0x 00, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00},97 {0x0 0, 0x40, 0xA0, 0xE0, 0xA0, 0x40, 0x00, 0x00},98 {0x0 0, 0x40, 0xC0, 0x40, 0x40, 0xE0, 0x00, 0x00},99 {0x0 0, 0xC0, 0x20, 0x40, 0x80, 0xE0, 0x00, 0x00},100 {0x0 0, 0xC0, 0x20, 0x40, 0x20, 0xC0, 0x00, 0x00},101 {0x0 0, 0x20, 0x60, 0xA0, 0xE0, 0x20, 0x00, 0x00},102 {0x0 0, 0xE0, 0x80, 0xC0, 0x20, 0xC0, 0x00, 0x00},103 {0x0 0, 0x60, 0x80, 0xC0, 0xA0, 0x40, 0x00, 0x00},104 {0x0 0, 0xE0, 0x20, 0x40, 0x40, 0x40, 0x00, 0x00},105 {0x0 0, 0x40, 0xA0, 0x40, 0xA0, 0x40, 0x00, 0x00},106 {0x0 0, 0x40, 0xA0, 0x60, 0x20, 0xC0, 0x00, 0x00},107 {0x00, 0x 00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00},108 {0x00, 0x 00, 0x40, 0x00, 0x00, 0x40, 0x80, 0x00},109 {0x0 0, 0x20, 0x40, 0x80, 0x40, 0x20, 0x00, 0x00},110 {0x00, 0x 00, 0xE0, 0x00, 0xE0, 0x00, 0x00, 0x00},111 {0x0 0, 0x80, 0x40, 0x20, 0x40, 0x80, 0x00, 0x00},112 {0x4 0, 0xA0, 0x20, 0x40, 0x00, 0x40, 0x00, 0x00},113 {0x4 0, 0xA0, 0x20, 0x60, 0xA0, 0x40, 0x00, 0x00},114 {0x4 0, 0xA0, 0xA0, 0xE0, 0xA0, 0xA0, 0x00, 0x00},115 {0xC 0, 0xA0, 0xC0, 0xA0, 0xA0, 0xC0, 0x00, 0x00},116 {0x6 0, 0x80, 0x80, 0x80, 0x80, 0x60, 0x00, 0x00},117 {0xC 0, 0xA0, 0xA0, 0xA0, 0xA0, 0xC0, 0x00, 0x00},118 {0xE 0, 0x80, 0xC0, 0x80, 0x80, 0xE0, 0x00, 0x00},119 {0xE 0, 0x80, 0xC0, 0x80, 0x80, 0x80, 0x00, 0x00},120 {0x6 0, 0x80, 0x80, 0xA0, 0xA0, 0x60, 0x00, 0x00},121 {0xA 0, 0xA0, 0xA0, 0xE0, 0xA0, 0xA0, 0x00, 0x00},122 {0xE 0, 0x40, 0x40, 0x40, 0x40, 0xE0, 0x00, 0x00},123 {0x2 0, 0x20, 0x20, 0x20, 0xA0, 0x40, 0x00, 0x00},124 {0xA 0, 0xA0, 0xC0, 0xA0, 0xA0, 0xA0, 0x00, 0x00},125 {0x8 0, 0x80, 0x80, 0x80, 0x80, 0xE0, 0x00, 0x00},126 {0xA 0, 0xE0, 0xE0, 0xA0, 0xA0, 0xA0, 0x00, 0x00},127 {0xC 0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0x00, 0x00},128 {0x4 0, 0xA0, 0xA0, 0xA0, 0xA0, 0x40, 0x00, 0x00},129 {0xC 0, 0xA0, 0xA0, 0xC0, 0x80, 0x80, 0x00, 0x00},130 {0x4 0, 0xA0, 0xA0, 0xA0, 0xA0, 0x40, 0x20, 0x00},131 {0xC 0, 0xA0, 0xA0, 0xC0, 0xA0, 0xA0, 0x00, 0x00},132 {0x6 0, 0x80, 0x40, 0x20, 0x20, 0xC0, 0x00, 0x00},133 {0xE 0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00},134 {0xA 0, 0xA0, 0xA0, 0xA0, 0xA0, 0xE0, 0x00, 0x00},135 {0xA 0, 0xA0, 0xA0, 0xA0, 0xC0, 0x80, 0x00, 0x00},136 {0xA 0, 0xA0, 0xA0, 0xE0, 0xE0, 0xA0, 0x00, 0x00},137 {0xA 0, 0xA0, 0x40, 0x40, 0xA0, 0xA0, 0x00, 0x00},138 {0xA 0, 0xA0, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00},139 {0xE 0, 0x20, 0x40, 0x40, 0x80, 0xE0, 0x00, 0x00},140 {0x6 0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x60, 0x00},141 {0xA 0, 0x40, 0xE0, 0x40, 0xE0, 0x40, 0x00, 0x00},142 {0xC 0, 0x40, 0x40, 0x40, 0x40, 0x40, 0xC0, 0x00},143 {0x4 0, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},144 {0x00, 0x00, 0x00, 0x 00, 0x00, 0x00, 0xE0, 0x00},145 {0x4 0, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},146 {0x00, 0x 00, 0x60, 0xA0, 0xA0, 0x60, 0x00, 0x00},147 {0x8 0, 0x80, 0xC0, 0xA0, 0xA0, 0xC0, 0x00, 0x00},148 {0x00, 0x 00, 0x60, 0x80, 0x80, 0x60, 0x00, 0x00},149 {0x2 0, 0x20, 0x60, 0xA0, 0xA0, 0x60, 0x00, 0x00},150 {0x00, 0x 00, 0x60, 0xE0, 0x80, 0x60, 0x00, 0x00},151 {0x6 0, 0x40, 0xE0, 0x40, 0x40, 0x40, 0x00, 0x00},152 {0x00, 0x 00, 0x60, 0xA0, 0x60, 0x20, 0xC0, 0x00},153 {0x8 0, 0x80, 0xC0, 0xA0, 0xA0, 0xA0, 0x00, 0x00},154 {0x40, 0x 00, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00},155 {0x40, 0x 00, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00},156 {0x8 0, 0x80, 0xA0, 0xC0, 0xA0, 0xA0, 0x00, 0x00},157 {0xC 0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00},158 {0x00, 0x 00, 0xC0, 0xE0, 0xE0, 0xA0, 0x00, 0x00},159 {0x00, 0x 00, 0xC0, 0xA0, 0xA0, 0xA0, 0x00, 0x00},160 {0x00, 0x 00, 0x40, 0xA0, 0xA0, 0x40, 0x00, 0x00},161 {0x00, 0x 00, 0xC0, 0xA0, 0xA0, 0xC0, 0x80, 0x00},162 {0x00, 0x 00, 0x60, 0xA0, 0xA0, 0x60, 0x20, 0x00},163 {0x00, 0x 00, 0xA0, 0xC0, 0x80, 0x80, 0x00, 0x00},164 {0x00, 0x 00, 0x60, 0xC0, 0x60, 0xC0, 0x00, 0x00},165 {0x0 0, 0x40, 0xE0, 0x40, 0x40, 0x60, 0x00, 0x00},166 {0x00, 0x 00, 0xA0, 0xA0, 0xA0, 0xE0, 0x00, 0x00},167 {0x00, 0x 00, 0xA0, 0xA0, 0xC0, 0x80, 0x00, 0x00},168 {0x00, 0x 00, 0xA0, 0xA0, 0xE0, 0xE0, 0x00, 0x00},169 {0x00, 0x 00, 0xA0, 0x40, 0x40, 0xA0, 0x00, 0x00},170 {0x00, 0x 00, 0xA0, 0xA0, 0x60, 0x20, 0xC0, 0x00},171 {0x00, 0x 00, 0xE0, 0x20, 0x40, 0xE0, 0x00, 0x00},172 {0x2 0, 0x40, 0x40, 0x80, 0x40, 0x40, 0x20, 0x00},173 {0x4 0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00},174 {0x8 0, 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}48 const 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} 177 177 }; 178 178 179 179 // 2バイトコード 1バイト目 180 unsigned charUtf8CodeTable_2B_1st[UTF8_CODE_2B_1_NUM][2] = {180 const uint8_t Utf8CodeTable_2B_1st[UTF8_CODE_2B_1_NUM][2] = { 181 181 {0xC2, 0x06}, 182 182 {0xC3, 0x02}, … … 187 187 }; 188 188 // 2バイトコード 2バイト目 bitmapデータ 189 struct utf8_code_bitmap UTF8_2B_CODE_BITMAP[UTF8_2B_CODE_BITMAP_NUM] = {189 const struct utf8_code_bitmap UTF8_2B_CODE_BITMAP[UTF8_2B_CODE_BITMAP_NUM] = { 190 190 {0xA7, {0x1C, 0x20, 0x18, 0x24, 0x18, 0x04, 0x38, 0x00}}, 191 191 {0xA8, {0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, … … 313 313 314 314 // 3バイトコード 1バイト目 315 unsigned charUtf8CodeTable_3B_1st[UTF8_CODE_3B_1_NUM][2] = {315 const uint8_t Utf8CodeTable_3B_1st[UTF8_CODE_3B_1_NUM][2] = { 316 316 {0xE2, 0x0E}, 317 317 {0xE3, 0x04}, … … 325 325 }; 326 326 // 3バイトコード 2バイト目 327 unsigned charUtf8CodeTable_3B_2nd[UTF8_CODE_3B_2_NUM][2] = {327 const uint8_t Utf8CodeTable_3B_2nd[UTF8_CODE_3B_2_NUM][2] = { 328 328 {0x80, 0x0F}, 329 329 {0x84, 0x02}, … … 673 673 674 674 // 3バイトコード 3バイト目 bitmapデータ 675 struct utf8_code_bitmap UTF8_3B_CODE_BITMAP[UTF8_3B_CODE_BITMAP_NUM] = {675 const struct utf8_code_bitmap UTF8_3B_CODE_BITMAP[UTF8_3B_CODE_BITMAP_NUM] = { 676 676 { 0x90 ,{0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00}}, 677 677 { 0x95 ,{0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00}}, -
asp3_tinet_ecnl_arm/trunk/ntshell/lcd/misaki_font.h
r352 r364 39 39 #define MISAKI_FONT_H 40 40 41 #include <stdint.h> 42 43 #define FONT_HALF_WIDTH 4 44 #define FONT_WIDTH 8 45 #define FONT_HEIGHT 8 46 41 47 struct utf8_code_bitmap { 42 unsigned charcode;43 unsigned char bitmap[8];48 const uint8_t code; 49 const uint8_t bitmap[FONT_WIDTH * FONT_HEIGHT / 8]; 44 50 }; 45 51 … … 48 54 #define UTF8_CODE_3B_2_NUM (343+1) /*半角追加2/2*/ 49 55 50 #define UTF8_CODE_BITMAP_NUM 6879 /*トータル*/51 56 #define UTF8_1B_CODE_BITMAP_NUM 128 52 57 #define UTF8_2B_CODE_BITMAP_NUM 122 /*"¬","\","¢""£"移動)*/ … … 54 59 55 60 // 1バイトコード 56 extern unsigned char UTF8_1B_CODE_BITMAP[UTF8_1B_CODE_BITMAP_NUM][8];61 extern const uint8_t UTF8_1B_CODE_BITMAP[UTF8_1B_CODE_BITMAP_NUM][FONT_HALF_WIDTH * FONT_HEIGHT / 8]; 57 62 58 63 // 2バイトコード 1バイト目 59 extern unsigned charUtf8CodeTable_2B_1st[UTF8_CODE_2B_1_NUM][2];64 extern const uint8_t Utf8CodeTable_2B_1st[UTF8_CODE_2B_1_NUM][2]; 60 65 // 2バイトコード 2バイト目 bitmapデータ 61 extern struct utf8_code_bitmap UTF8_2B_CODE_BITMAP[UTF8_2B_CODE_BITMAP_NUM];66 extern const struct utf8_code_bitmap UTF8_2B_CODE_BITMAP[UTF8_2B_CODE_BITMAP_NUM]; 62 67 63 68 // 3バイトコード 1バイト目 64 extern unsigned charUtf8CodeTable_3B_1st[UTF8_CODE_3B_1_NUM][2];69 extern const uint8_t Utf8CodeTable_3B_1st[UTF8_CODE_3B_1_NUM][2]; 65 70 // 3バイトコード 2バイト目 66 extern unsigned charUtf8CodeTable_3B_2nd[UTF8_CODE_3B_2_NUM][2];71 extern const uint8_t Utf8CodeTable_3B_2nd[UTF8_CODE_3B_2_NUM][2]; 67 72 68 73 // 3バイトコード 3バイト目 bitmapデータ 69 extern struct utf8_code_bitmap UTF8_3B_CODE_BITMAP[UTF8_3B_CODE_BITMAP_NUM];74 extern const struct utf8_code_bitmap UTF8_3B_CODE_BITMAP[UTF8_3B_CODE_BITMAP_NUM]; 70 75 71 76 #endif /* MISAKI_FONT_H */
Note:
See TracChangeset
for help on using the changeset viewer.