Create more fonts

This commit is contained in:
Steven Tracey 2024-11-22 16:12:49 -05:00
parent 3988615687
commit 449b7b4d0e
19 changed files with 36 additions and 25 deletions

11
c/libs/Fonts/font40.c Normal file
View File

@ -0,0 +1,11 @@
//
// Created by steven on 11/22/2024.
//
#include "fonts.h"
const unsigned char Font40_Table[] = {};
sFONT Font40 = {
Font40_Table,
22, /* Width */
40, /* Height */
};

11
c/libs/Fonts/font56.c Normal file
View File

@ -0,0 +1,11 @@
//
// Created by steven on 11/22/2024.
//
#include "fonts.h"
const unsigned char Font56_Table[] = {};
sFONT Font56 = {
Font56_Table,
30, /* Width */
56, /* Height */
};

View File

@ -1,6 +1,6 @@
#include "fonts.h"
const unsigned char Font36_Table[] = {
const unsigned char Font65_Table[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // Character 0x00 (0)
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // Character 0x01 (1)
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x07,0x80,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x7E,0x0F,0xC0,0x00,0x00,0x3C,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // Character 0x02 (2)
@ -99,8 +99,8 @@ const unsigned char Font36_Table[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // Character 0x5F (95)
};
sFONT Font36 = {
Font36_Table,
sFONT Font65 = {
Font65_Table,
36, /* Width */
65, /* Height */
};

View File

@ -39,7 +39,6 @@
#ifndef __FONTS_H
#define __FONTS_H
/*最大字体微软雅黑24 (32x41) */
#define MAX_HEIGHT_FONT 65
#define MAX_WIDTH_FONT 36
#define OFFSET_BITMAP
@ -60,26 +59,9 @@ typedef struct _tFont
} sFONT;
//GB2312
// typedef struct // 汉字字模数据结构
// {
// const char index[2]; // 汉字内码索引
// const char matrix[MAX_HEIGHT_FONT*MAX_WIDTH_FONT/8+2]; // 点阵码数据
// }CH_CN;
//typedef struct
//{
// const CH_CN *table;
// uint16_t size;
// uint16_t ASCII_Width;
// uint16_t Width;
// uint16_t Height;
//}cFONT;
extern sFONT Font36;
extern sFONT Font65;
extern sFONT Font56;
extern sFONT Font40;
extern sFONT Font24;
extern sFONT Font20;
extern sFONT Font16;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

View File

@ -54,7 +54,14 @@ void code(UWORD *blackImage, char* confName) {
GoString confStr = {confName, strlen(confName)};
const char *code = getCode(confStr);
Paint_DrawString(5, 20, code, &Font36, WHITE, BLACK);
int codeLength = strlen(code);
if (codeLength <= 6) {
Paint_DrawString(5, 20, code, &Font65, WHITE, BLACK);
} else if (codeLength > 6) {
Paint_DrawString(5, 20, code, &Font56, WHITE, BLACK);
} else if (codeLength > 8) {
Paint_DrawString(5, 20, code, &Font40, WHITE, BLACK);
}
Paint_DrawString(8, 5, confName, &Font12, WHITE, BLACK);
Paint_DrawRectangle(10, 114, 240, 94, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);