2017-05-29 07:54:57 +00:00
|
|
|
#ifndef _INCLUDE_GUI_FONT_H_
|
|
|
|
#define _INCLUDE_GUI_FONT_H_
|
2017-06-02 12:33:13 +00:00
|
|
|
//=======================================================================//
|
2019-02-24 15:03:05 +00:00
|
|
|
//= Include files. =//
|
2017-06-02 12:33:13 +00:00
|
|
|
//=======================================================================//
|
2017-08-02 14:24:26 +00:00
|
|
|
#include "SGUI_Common.h"
|
|
|
|
#include "SGUI_Basic.h"
|
2017-05-29 07:54:57 +00:00
|
|
|
|
2017-06-02 12:33:13 +00:00
|
|
|
//=======================================================================//
|
|
|
|
//= User Macro definition. =//
|
|
|
|
//=======================================================================//
|
2017-05-29 07:54:57 +00:00
|
|
|
#define FONT_LIB_ADDR 0X00000
|
|
|
|
#define FONT_LIB_OFFSET_ASCII (-32)
|
|
|
|
#define FONT_LIB_OFFSET_GB2312_SYMBOL (95)
|
|
|
|
#define FONT_LIB_OFFSET_GB2312_CHARL1 (659)
|
|
|
|
// Max font size is 64 pix, maximum of font data size is 64 * 8 = 512 Bytes.
|
|
|
|
#define FONT_DATA_BUFFER_SIZE (512)
|
|
|
|
#define TEXT_NUMBER_STR_LENGTH_MAX (12)
|
|
|
|
#define TEXT_PLACEHOLDER_CHARACTER ('*')
|
|
|
|
|
2017-06-02 12:33:13 +00:00
|
|
|
//=======================================================================//
|
|
|
|
//= Data type definition. =//
|
|
|
|
//=======================================================================//
|
2017-05-29 07:54:57 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2017-08-02 14:24:26 +00:00
|
|
|
const SGUI_UINT16 Size;
|
|
|
|
const SGUI_UINT16 Width;
|
|
|
|
const SGUI_UINT16 Height;
|
2018-10-29 15:51:57 +00:00
|
|
|
const SGUI_UINT16 HalfCharDataSize;
|
2017-08-02 14:24:26 +00:00
|
|
|
}SGUI_FONT_SIZE_STRUCT;
|
2017-05-29 07:54:57 +00:00
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
2017-08-02 14:24:26 +00:00
|
|
|
SGUI_FONT_SIZE_H6 = 0,
|
|
|
|
SGUI_FONT_SIZE_H8,
|
|
|
|
SGUI_FONT_SIZE_H12,
|
|
|
|
SGUI_FONT_SIZE_H16,
|
|
|
|
SGUI_FONT_SIZE_H24,
|
|
|
|
SGUI_FONT_SIZE_H32,
|
|
|
|
SGUI_FONT_SIZE_MAX,
|
|
|
|
}SGUI_FONT_SIZE;
|
2017-05-29 07:54:57 +00:00
|
|
|
|
2017-06-02 12:33:13 +00:00
|
|
|
//=======================================================================//
|
|
|
|
//= Public variable declaration. =//
|
|
|
|
//=======================================================================//
|
2017-08-02 14:24:26 +00:00
|
|
|
extern const SGUI_FONT_SIZE_STRUCT g_stFontSize[];
|
2017-05-29 07:54:57 +00:00
|
|
|
|
2017-06-02 12:33:13 +00:00
|
|
|
//=======================================================================//
|
|
|
|
//= Public function declaration. =//
|
|
|
|
//=======================================================================//
|
2019-01-11 14:03:38 +00:00
|
|
|
void SGUI_Text_DrawSingleLineText(SGUI_SCR_DEV* pstIFObj, SGUI_CSZSTR szTextBuffer, SGUI_FONT_SIZE eFontSize, SGUI_RECT_AREA* pstDisplayArea, SGUI_RECT_AREA* pstStringDataArea, SGUI_DRAW_MODE eFontMode);
|
|
|
|
SGUI_SIZE SGUI_Text_DrawMultipleLinesText(SGUI_SCR_DEV* pstIFObj, SGUI_CSZSTR szTextBuffer, SGUI_FONT_SIZE eFontSize, SGUI_RECT_AREA* pstDisplayArea, SGUI_INT iTopOffset, SGUI_DRAW_MODE eFontMode);
|
2018-12-12 13:06:03 +00:00
|
|
|
SGUI_SIZE SGUI_Text_GetTextGraphicsWidth(SGUI_CSZSTR szText, SGUI_FONT_SIZE eFontSize);
|
|
|
|
SGUI_SIZE SGUI_Text_GetMultiLineTextLines(SGUI_CSZSTR szNoticeText, SGUI_SIZE uiHalfWidthCharInLine);
|
2017-05-29 07:54:57 +00:00
|
|
|
|
|
|
|
#endif
|