Small ui tweaks
This commit is contained in:
parent
1cb5f8bc89
commit
28e9124c09
@ -62,22 +62,22 @@ typedef struct _tFont
|
||||
|
||||
|
||||
//GB2312
|
||||
typedef struct // 汉字字模数据结构
|
||||
{
|
||||
const char index[2]; // 汉字内码索引
|
||||
const char matrix[MAX_HEIGHT_FONT*MAX_WIDTH_FONT/8+2]; // 点阵码数据
|
||||
}CH_CN;
|
||||
// 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;
|
||||
//typedef struct
|
||||
//{
|
||||
// const CH_CN *table;
|
||||
// uint16_t size;
|
||||
// uint16_t ASCII_Width;
|
||||
// uint16_t Width;
|
||||
// uint16_t Height;
|
||||
|
||||
}cFONT;
|
||||
//}cFONT;
|
||||
|
||||
extern sFONT Font36;
|
||||
extern sFONT Font24;
|
||||
|
12
c/src/p2fa.c
12
c/src/p2fa.c
@ -33,6 +33,10 @@ void Handler(int sigNum) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int computeWidth(char* text, sFONT *font) {
|
||||
return (font->Width) * strlen(text);
|
||||
}
|
||||
|
||||
void code(UWORD *blackImage, char* confName) {
|
||||
int ch;
|
||||
codeLoop:
|
||||
@ -52,7 +56,7 @@ void code(UWORD *blackImage, char* confName) {
|
||||
const char *code = getCode(confStr);
|
||||
DebugLine(3, 0, "Code: %s\n", code);
|
||||
Paint_DrawString(5, 20, code, &Font36, WHITE, BLACK);
|
||||
Paint_DrawString(5, 5, confName, &Font12, WHITE, BLACK);
|
||||
Paint_DrawString(8, 5, confName, &Font12, WHITE, BLACK);
|
||||
|
||||
Paint_DrawRectangle(10, 114, 240, 94, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
|
||||
EPD_2in13_V4_Display_Base(blackImage);
|
||||
@ -77,11 +81,11 @@ void code(UWORD *blackImage, char* confName) {
|
||||
DebugLine(4, 0, "Time Left: %d\n", i);
|
||||
double percentLeft = (double) i / (double) (30 * 1000);
|
||||
progBarEndIndex = 228 - (int) (228 * percentLeft);
|
||||
Paint_ClearWindows(progBarCurrentIndex, 113, progBarEndIndex, 93, WHITE);
|
||||
Paint_ClearWindows(progBarCurrentIndex, 113, progBarEndIndex, 95, WHITE);
|
||||
int line = 15;
|
||||
while (progBarCurrentIndex < progBarEndIndex) {
|
||||
DebugLine(line, 0, "Line: %d,113 - %d,93\n", progBarCurrentIndex, progBarEndIndex);
|
||||
Paint_DrawLine(progBarCurrentIndex, 113, progBarCurrentIndex, 93, BLACK, DOT_PIXEL_1X1,
|
||||
DebugLine(line, 0, "Line: %d,113 - %d,95\n", progBarCurrentIndex, progBarEndIndex);
|
||||
Paint_DrawLine(progBarCurrentIndex, 113, progBarCurrentIndex, 95, BLACK, DOT_PIXEL_1X1,
|
||||
LINE_STYLE_SOLID);
|
||||
++progBarCurrentIndex;
|
||||
++line;
|
||||
|
Loading…
Reference in New Issue
Block a user