font_type.c
/*********************************************************************
* 字体类型定义文件
* (c)copyright 2015,jdh
* All Right Reserved
*修改日期:2015/2/2 by jdh
*修改日期:2015/2/3 by jdh
*修改日期:2015/2/5 by jdh
**********************************************************************/
#include "font_type.h"
extern int GUIPROP_X_GetCharDistX(U16P c);
extern void GUIPROP_X_DispChar(U16P c) ;
extern void GUI_UC_SetEncodeNone_User(void);
/*********************************************************************
* 全局变量
**********************************************************************/
/*********************************************************************
* 当前字体
**********************************************************************/
uint8_t Font_Now = 0;
GUI_CONST_STORAGE GUI_CHARINFO GUI_FontHZ12_CharInfo[2] =
{
{ 6, 6, 1, (void *)"1:/system/gui_font/ASC6x12.bin" }, //&ASC_ROM_8X16
{ 12, 12, 2, (void *)"1:/system/gui_font/HZ12x12.bin"}, //&HZ_ROM_16X16
};
GUI_CONST_STORAGE GUI_FONT_PROP GUI_FontHZ12_PropHZ= {
// 0xA1A1,
// 0xF7FE,
0xA1A1,
0xFFFF,
&GUI_FontHZ12_CharInfo[1],
(void *)0,
};
GUI_CONST_STORAGE GUI_FONT_PROP GUI_FontHZ12_PropASC= {
0x0000,
0x007F,
&GUI_FontHZ12_CharInfo[0],
(void GUI_CONST_STORAGE *)&GUI_FontHZ12_PropHZ,
};
//GUI_CONST_STORAGE GUI_FONT GUI_FontHZ12 =
//{
// GUI_FONTTYPE_PROP_USER,
// 12, //XSIZE
// 12, //YSIZE
// 1, //X方向放大倍数
// 1, //Y方向放大倍数
// (void GUI_CONST_STORAGE *)&GUI_FontHZ12_PropASC
//};
GUI_CONST_STORAGE GUI_FONT GUI_FontHZ12 =
{
GUI_FONTTYPE_PROP_USER,
12, //XSIZE
12, //YSIZE
1, //X方向放大倍数
1, //Y方向放大倍数
(void GUI_CONST_STORAGE *)&GUI_FontHZ12_PropASC
};
GUI_CONST_STORAGE GUI_FONT GUI_FontHZ12x2 =
{
GUI_FONTTYPE_PROP_USER,
12,
12,
2,
2,
(void GUI_CONST_STORAGE *)&GUI_FontHZ12_PropASC
};
/*********************************************************************
* GUI结构:7*8点阵ASCII标准字符
**********************************************************************/
GUI_CONST_STORAGE GUI_CHARINFO GUI_ASCII_7X8_CharInfo[1] =
{
{ ASCII_7X8_WIDTH, ASCII_7X8_HEIGHT, 1, (void *)0 },
};
GUI_CONST_STORAGE GUI_FONT_PROP GUI_ASCII_7X8_PropASC =
{
0x0000,
0x007F,
&GUI_ASCII_7X8_CharInfo[0],
(void *)0
};
GUI_CONST_STORAGE GUI_FONT GUI_ASCII_7X8 =
{
GUI_FONTTYPE_PROP_USER,
ASCII_7X8_WIDTH * 2, //XSIZE
ASCII_7X8_HEIGHT, //YSIZE
1, //X方向放大倍数
1, //Y方向放大倍数
(void GUI_CONST_STORAGE *)&GUI_ASCII_7X8_PropASC
};
/*********************************************************************
* GUI结构:7*8点阵ASCII粗体字符
**********************************************************************/
GUI_CONST_STORAGE GUI_CHARINFO GUI_ASCII_BOLD_7X8_CharInfo[1] =
{
{ ASCII_BOLD_7X8_WIDTH, ASCII_BOLD_7X8_HEIGHT, 1, (void *)0 },
};
GUI_CONST_STORAGE GUI_FONT_PROP GUI_ASCII_BOLD_7X8_PropASC =
{
0x0000,
0x007F,
&GUI_ASCII_BOLD_7X8_CharInfo[0],
(void *)0
};
GUI_CONST_STORAGE GUI_FONT GUI_ASCII_BOLD_7X8 =
{
GUI_FONTTYPE_PROP_USER,
ASCII_BOLD_7X8_WIDTH * 2, //XSIZE
ASCII_BOLD_7X8_HEIGHT, //YSIZE
1, //X方向放大倍数
1, //Y方向放大倍数
(void GUI_CONST_STORAGE *)&GUI_ASCII_BOLD_7X8_PropASC
};
/*********************************************************************
* GUI结构:6*12点阵ASCII标准字符
**********************************************************************/
GUI_CONST_STORAGE GUI_CHARINFO GUI_ASCII_6X12_CharInfo[1] =
{
{ ASCII_6X12_WIDTH, ASCII_6X12_HEIGHT / 2, 1, (void *)0 },
};
GUI_CONST_STORAGE GUI_FONT_PROP GUI_ASCII_6X12_PropASC =
{
0x0000,
0x007F,
&GUI_ASCII_6X12_CharInfo[0],
(void *)0
};
GUI_CONST_STORAGE GUI_FONT GUI_ASCII_6X12 =
{
GUI_FONTTYPE_PROP_USER,
ASCII_6X12_WIDTH * 2, //XSIZE
ASCII_6X12_HEIGHT, //YSIZE
1, //X方向放大倍数
1, //Y方向放大倍数
(void GUI_CONST_STORAGE *)&GUI_ASCII_6X12_PropASC
};
/*********************************************************************
* GUI结构:8*16点阵ASCII标准字符
**********************************************************************/
GUI_CONST_STORAGE GUI_CHARINFO GUI_ASCII_8X16_CharInfo[1] =
{
{ ASCII_8X16_WIDTH, ASCII_8X16_HEIGHT / 2, 1, (void *)0 },
};
GUI_CONST_STORAGE GUI_FONT_PROP GUI_ASCII_8X16_PropASC =
{
0x0000,
0x007F,
&GUI_ASCII_8X16_CharInfo[0],
(void *)0
};
GUI_CONST_STORAGE GUI_FONT GUI_ASCII_8X16 =
{
GUI_FONTTYPE_PROP_USER,
ASCII_8X16_WIDTH * 2, //XSIZE
ASCII_8X16_HEIGHT, //YSIZE
1, //X方向放大倍数
1, //Y方向放大倍数
(void GUI_CONST_STORAGE *)&GUI_ASCII_8X16_PropASC
};
/*********************************************************************
* GUI结构:8*16点阵ASCII粗体字符
**********************************************************************/
GUI_CONST_STORAGE GUI_CHARINFO GUI_ASCII_BOLD_8X16_CharInfo[1] =
{
{ ASCII_BOLD_8X16_WIDTH, ASCII_BOLD_8X16_HEIGHT / 2, 1, (void *)0 },
};
GUI_CONST_STORAGE GUI_FONT_PROP GUI_ASCII_BOLD_8X16_PropASC =
{
0x0000,
0x007F,
&GUI_ASCII_BOLD_8X16_CharInfo[0],
(void *)0
};
GUI_CONST_STORAGE GUI_FONT GUI_ASCII_BOLD_8X16 =
{
GUI_FONTTYPE_PROP_USER,
ASCII_BOLD_8X16_WIDTH * 2, //XSIZE
ASCII_BOLD_8X16_HEIGHT, //YSIZE
1, //X方向放大倍数
1, //Y方向放大倍数
(void GUI_CONST_STORAGE *)&GUI_ASCII_BOLD_8X16_PropASC
};
/*********************************************************************
* GUI结构:12*24点阵ASCII标准字符
**********************************************************************/
GUI_CONST_STORAGE GUI_CHARINFO GUI_ASCII_12X24_CharInfo[1] =
{
{ ASCII_12X24_WIDTH, ASCII_12X24_HEIGHT / 2, 2, (void *)0 },
};
GUI_CONST_STORAGE GUI_FONT_PROP GUI_ASCII_12X24_PropASC =
{
0x0000,
0x007F,
&GUI_ASCII_12X24_CharInfo[0],
(void *)0
};
GUI_CONST_STORAGE GUI_FONT GUI_ASCII_12X24 =
{
GUI_FONTTYPE_PROP_USER,
ASCII_12X24_WIDTH * 2, //XSIZE
ASCII_12X24_HEIGHT, //YSIZE
1, //X方向放大倍数
1, //Y方向放大倍数
(void GUI_CONST_STORAGE *)&GUI_ASCII_12X24_PropASC
};
/*********************************************************************
* GUI结构:16*32点阵ASCII标准字符
**********************************************************************/
GUI_CONST_STORAGE GUI_CHARINFO GUI_ASCII_16X32_CharInfo[1] =
{
{ ASCII_16X32_WIDTH, ASCII_16X32_HEIGHT / 2, 2, (void *)0 },
};
GUI_CONST_STORAGE GUI_FONT_PROP GUI_ASCII_16X32_PropASC =
{
0x0000,
0x007F,
&GUI_ASCII_16X32_CharInfo[0],
(void *)0
};
GUI_CONST_STORAGE GUI_FONT GUI_ASCII_16X32 =
{
GUI_FONTTYPE_PROP_USER,
ASCII_16X32_WIDTH * 2, //XSIZE
ASCII_16X32_HEIGHT, //YSIZE
1, //X方向放大倍数
1, //Y方向放大倍数
(void GUI_CONST_STORAGE *)&GUI_ASCII_16X32_PropASC
};
/*********************************************************************
* GUI结构:16*32点阵ASCII粗体字符
**********************************************************************/
GUI_CONST_STORAGE GUI_CHARINFO GUI_ASCII_BOLD_16X32_CharInfo[1] =
{
{ ASCII_BOLD_16X32_WIDTH, ASCII_BOLD_16X32_HEIGHT / 2, 2, (void *)0 },
};
GUI_CONST_STORAGE GUI_FONT_PROP GUI_ASCII_BOLD_16X32_PropASC =
{
0x0000,
0x007F,
&GUI_ASCII_BOLD_16X32_CharInfo[0],
(void *)0
};
GUI_CONST_STORAGE GUI_FONT GUI_ASCII_BOLD_16X32 =
{
GUI_FONTTYPE_PROP_USER,
ASCII_BOLD_16X32_WIDTH * 2, //XSIZE
ASCII_BOLD_16X32_HEIGHT, //YSIZE
1, //X方向放大倍数
1, //Y方向放大倍数
(void GUI_CONST_STORAGE *)&GUI_ASCII_BOLD_16X32_PropASC
};
/*********************************************************************
* GUI结构:12*12点阵GB18030汉字
**********************************************************************/
GUI_CONST_STORAGE GUI_CHARINFO GUI_GB18030_12X12_CharInfo[1] =
{
{ GB18030_12X12_WIDTH, GB18030_12X12_HEIGHT, 2, (void *)0 },
};
GUI_CONST_STORAGE GUI_FONT_PROP GUI_GB18030_12X12_PropASC =
{
0x0,
0xFFFF,
&GUI_GB18030_12X12_CharInfo[0],
(void *)0
};
GUI_CONST_STORAGE GUI_FONT GUI_GB18030_12X12 =
{
GUI_FONTTYPE_PROP_USER,
GB18030_12X12_WIDTH, //XSIZE
GB18030_12X12_HEIGHT, //YSIZE
1, //X方向放大倍数
1, //Y方向放大倍数
(void GUI_CONST_STORAGE *)&GUI_GB18030_12X12_PropASC
};
/*********************************************************************
* GUI结构:16*16点阵GB18030汉字
**********************************************************************/
GUI_CONST_STORAGE GUI_CHARINFO GUI_GB18030_16X16_CharInfo[1] =
{
{ GB18030_16X16_WIDTH, GB18030_16X16_HEIGHT, 2, (void *)0 },
};
GUI_CONST_STORAGE GUI_FONT_PROP GUI_GB18030_16X16_PropASC =
{
0x0,
0xFFFF,
&GUI_GB18030_16X16_CharInfo[0],
(void *)0
};
GUI_CONST_STORAGE GUI_FONT GUI_GB18030_16X16 =
{
GUI_FONTTYPE_PROP_USER,
GB18030_16X16_WIDTH, //XSIZE
GB18030_16X16_HEIGHT, //YSIZE
1, //X方向放大倍数
1, //Y方向放大倍数
(void GUI_CONST_STORAGE *)&GUI_GB18030_16X16_PropASC
};
/*********************************************************************
* GUI结构:24*24点阵GB18030汉字
**********************************************************************/
GUI_CONST_STORAGE GUI_CHARINFO GUI_GB18030_24X24_CharInfo[1] =
{
{ GB18030_24X24_WIDTH, GB18030_24X24_HEIGHT, 3, (void *)0 },
};
GUI_CONST_STORAGE GUI_FONT_PROP GUI_GB18030_24X24_PropASC =
{
0x0,
0xFFFF,
&GUI_GB18030_24X24_CharInfo[0],
(void *)0
};
GUI_CONST_STORAGE GUI_FONT GUI_GB18030_24X24 =
{
GUI_FONTTYPE_PROP_USER,
GB18030_24X24_WIDTH, //XSIZE
GB18030_24X24_HEIGHT, //YSIZE
1, //X方向放大倍数
1, //Y方向放大倍数
(void GUI_CONST_STORAGE *)&GUI_GB18030_24X24_PropASC
};
/*********************************************************************
* 设置字体
*说明:在使用字体前,必须先调用此函数
*参数:font:字体
**********************************************************************/
void set_font(uint8_t font)
{
GUI_UC_SetEncodeNone_User();
Font_Now = font;
// switch (font)
// {
// case ASCII_7X8:
// {
// GUI_SetFont(&GUI_ASCII_7X8);
// break;
// }
// case ASCII_BOLD_7X8:
// {
// GUI_SetFont(&GUI_ASCII_BOLD_7X8);
// break;
// }
// case ASCII_6X12:
// {
// GUI_SetFont(&GUI_ASCII_6X12);
// break;
// }
// case ASCII_8X16:
// {
// GUI_SetFont(&GUI_ASCII_8X16);
// break;
// }
// case ASCII_BOLD_8X16:
// {
// GUI_SetFont(&GUI_ASCII_BOLD_8X16);
// break;
// }
// case ASCII_12X24:
// {
// GUI_SetFont(&GUI_ASCII_12X24);
// break;
// }
// case ASCII_16X32:
// {
// GUI_SetFont(&GUI_ASCII_16X32);
// break;
// }
// case ASCII_BOLD_16X32:
// {
// GUI_SetFont(&GUI_ASCII_BOLD_16X32);
// break;
// }
// case GB18030_12X12:
// {
// GUI_SetFont(&GUI_GB18030_12X12);
// break;
// }
// case GB18030_16X16:
// {
// GUI_SetFont(&GUI_GB18030_16X16);
// break;
// }
// case GB18030_24X24:
// {
// GUI_SetFont(&GUI_GB18030_24X24);
// break;
// }
// }
}
|