⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uifont.h

📁 嵌入工linux开发的源码
💻 H
字号:
/*********************************************************************/
//	文 件 名:	uiFont.h
//	程序说明:	字体管理
//	程序设计:	张学平
//				2001.10.23		设计完成		说明文档:R004-S231-0001
//				2002.03.09		增加对自定义字的处理和取得字体点阵的功能
//	程序审查:	宋军霞
//				2002.01.22		审查完成		说明文档:R004-S231-0001
//	项目编号:	R004-S231
//	版	  本:	V1.0
//	版    权:	Reality Plus Technology (ShenZhen) Co.,Ltd.
/*********************************************************************/
#ifndef _GUIFONT_H
#define _GUIFONT_H

#include <pr2k.h>
#include <typedefine.h>
#include <uiGui_cfg.h>
#include <uiGraph.h>

// **************************************************************************
//	下面的四个字体类型常量,用户可根据需要修改,
//		注意:	所有的常量均不要大于等于MAX_FONT_NUM
// **************************************************************************
#define FONT_ENG12_GB12        0	//	12点阵普通简体
#define FONT_ENGHT12_GB12      1	//	12点阵黑体简体
#define FONT_ENG12_BIG12       2	//	12点阵普通繁体
#define FONT_ENGHT12_BIG12     3	//	12点阵黑体繁体


//#define FONT_ENG14_GB14	2	//	14点阵普通字体
//#define FONT_ENGHT14_GB14	3	//	14点阵黑体字体

// **************************************************************************
//	MAX_FONT_NUM为系统最大字体数,用户可根据需要修改
//		注意:	使用时的字体类型不要超过它
// **************************************************************************
#define MAX_FONT_NUM		6	/* max of font type */

/* style of font display*/
#define FONT_TRANSPARENT 		0x00	//透明
#define FONT_NON_TRANSPARENT 	0x01	//不透明

#define FONT_CHAR_GAP			0x01	//字符间距
#define FONT_LINE_GAP			0x02	//行间距

/*************************************************************
字符功能函数原型
*************************************************************/
typedef void (*PF_ShowChar)(HNDL, const char, int, int, int, int) ;
typedef void (*PF_ShowCharInView)(TRect *, const char, int, int, int, int) ;
typedef short (*PF_GetCharWidth)(const char) ;
typedef short (*PF_GetCharHeight)(void) ;
typedef unsigned short *(*PF_GetCharBitmap)(const char);

typedef void (*PF_ShowWord)(HNDL, const char *, int, int, int, int) ;
typedef void (*PF_ShowWordInView)(TRect *, const char *, int, int, int, int) ;
typedef short (*PF_GetWordWidth)(void) ;
typedef short (*PF_GetWordHeight)(void) ;
typedef unsigned short *(*PF_GetWordBitmap)(const char *);

/*************************************************************
STRUCTURE DECLARATION
*************************************************************/
typedef struct tagShowFont
{
	PF_ShowChar			ShowChar;
	PF_ShowCharInView	ShowCharInView;
	PF_GetCharWidth		GetCharWidth;
	PF_GetCharHeight	GetCharHeight;
	PF_GetCharBitmap	GetCharBitmap;
	
	PF_ShowWord			ShowWord;
	PF_ShowWordInView	ShowWordInView;
	PF_GetWordWidth		GetWordWidth;
	PF_GetWordHeight	GetWordHeight;
	PF_GetWordBitmap	GetWordBitmap;
} TShowFont;

extern TShowFont gShowFont[];

// 字体管理
void guiInitFont(void);			/* call by system */
void guiUserInitfont(void);		/* programe by developer*/
int  guiPushFont(int type) ;
int  guiPopFont(void) ;	
DLL_EXP(int)  guiSetFont(int type) ;
DLL_EXP(int)  guiGetFont(void) ;
DLL_EXP(void) guiSetFontOps(int type,TShowFont tShowFont);	/* 设置字体操作函数 */

// color is complex,
// style: FONT_NON_TRANSPARENT, FONT_TRANSPARENT

// 字符和文字的显示及高度和宽度的获取
DLL_EXP(void) guiShowChar(HNDL handle, const char ascii, int x, int y, int color, int style);
void _guiShowCharInView(TRect *rect, const char ascii, int x, int y, int color, int style);
DLL_EXP(short) guiGetCharWidth(const char ascii);
DLL_EXP(short) guiGetCharHeight(void);

DLL_EXP(void) guiShowWord(HNDL handle, const char *pCode, int x, int y, int color, int style);
void _guiShowWordInView(TRect *rect, const char *pCode, int x, int y, int color, int style);
DLL_EXP(short) guiGetWordWidth(void);
DLL_EXP(short) guiGetWordHeight(void);

// 字符串的显示及高度和宽度的获取
DLL_EXP(void) guiShowString(HNDL handle, const char *string,int x,int y, int color, int style);
DLL_EXP(void) guiShowStringInArea(HNDL handle, const char *string, int x1, int y1,int x2, int y2, int color, int style);
DLL_EXP(int) guiGetStringHeight(void);
DLL_EXP(int) guiGetStringWidth(const char *string);

// 获取字符的点阵位图
DLL_EXP(unsigned short *)guiGetWordBitmap(const char *pCode);
DLL_EXP(unsigned short *)guiGetCharBitmap(const char ascii);
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -