📄 uiuserfont.c
字号:
/*********************************************************************/
// 文 件 名: uiUserFont.cpp
// 程序说明: 字体管理
// 程序设计: 张学平
// 2001.10.23 设计完成 说明文档:R004-S231-0001
// 2002.03.09 去掉14点阵字体
// 2002.03.10 增加自定义字的初始化和取得字符点阵的功能
// 程序审查: 宋军霞
// 2002.01.22 审查完成 说明文档:R004-S231-0001
// 项目编号: R004-S231
// 版 本: V1.0
// 版 权: Reality Plus Technology (ShenZhen) Co.,Ltd.
/*********************************************************************/
// ===========================================================================
// 本模块为用户字体接口,用户可以根据需要修改
// ===========================================================================
#include <uiFont.h>
#include <uiUtility.h>
#include <uiGui_Cfg.h>
#include <sysVar.h>
// 下面为系统提供的六个字体处理模块,用户可根据系统需要来确定要采用何种字体,并将不需要
// 的字体删除,以减小程序空间
#include <uiEng12.h>
//#include <uiEng14.h>
#include <uiGB12.h>
#include <uiBIG12.h>
//#include <uiGB14.h>
#include <uiEng12HT.h>
//#include <uiEng14HT.h>
#ifdef GUI_FONTEX
#include <uiFontEx.h>
#endif
// 字体管理数组,用户不要删除或修改它
TShowFont gShowFont[MAX_FONT_NUM];
// 用户字体初始化程序,GUI系统将调用它,其函数原型和函数名称一定不能变更
void guiUserInitfont(void)
{
int i,langType;
TShowFont tShowFont;
// 清空所有系统字符,用户不要删除或修改
tShowFont.ShowChar = NULL ;
tShowFont.ShowCharInView = NULL;
tShowFont.GetCharWidth = NULL;
tShowFont.GetCharHeight = NULL;
tShowFont.ShowWord = NULL ;
tShowFont.ShowWordInView = NULL;
tShowFont.GetWordWidth = NULL;
tShowFont.GetWordHeight = NULL;
for( i=0 ; i< MAX_FONT_NUM ; i++ )
{
guiSetFontOps(i,tShowFont);
}
// 设置操作函数字体,用户可以根据需要修改下面的部分
// 设置12点阵普通字体
tShowFont.ShowChar = (PF_ShowChar)guiShowEng12;
tShowFont.ShowCharInView = (PF_ShowCharInView)_guiShowEng12InView;
tShowFont.GetCharWidth = (PF_GetCharWidth)guiGetEng12Width;
tShowFont.GetCharHeight = (PF_GetCharHeight)guiGetEng12Height;
tShowFont.GetCharBitmap = (PF_GetCharBitmap)guiGetEng12Bitmap;
tShowFont.ShowWord = (PF_ShowWord)guiShowGB12Word;
tShowFont.ShowWordInView = (PF_ShowWordInView)_guiShowGB12WordInView;
tShowFont.GetWordWidth = (PF_GetWordWidth)guiGetGB12WordWidth;
tShowFont.GetWordHeight = (PF_GetWordHeight)guiGetGB12WordHeight;
tShowFont.GetWordBitmap = (PF_GetWordBitmap)guiGetGB12Bitmap;
guiSetFontOps( FONT_ENG12_GB12, tShowFont);
// 设置12点阵黑体字体
tShowFont.ShowChar = (PF_ShowChar)guiShowEng12HT;
tShowFont.ShowCharInView = (PF_ShowCharInView)_guiShowEng12HTInView;
tShowFont.GetCharWidth = (PF_GetCharWidth)guiGetEng12HTWidth;
tShowFont.GetCharHeight = (PF_GetCharHeight)guiGetEng12HTHeight;
tShowFont.GetCharBitmap = (PF_GetCharBitmap)guiGetEng12HTBitmap;
tShowFont.ShowWord = (PF_ShowWord)guiShowGB12Word;
tShowFont.ShowWordInView = (PF_ShowWordInView)_guiShowGB12WordInView;
tShowFont.GetWordWidth = (PF_GetWordWidth)guiGetGB12WordWidth;
tShowFont.GetWordHeight = (PF_GetWordHeight)guiGetGB12WordHeight;
tShowFont.GetWordBitmap = (PF_GetWordBitmap)guiGetGB12Bitmap;
guiSetFontOps( FONT_ENGHT12_GB12, tShowFont);
// 设置12点阵普通繁体
tShowFont.ShowChar = (PF_ShowChar)guiShowEng12;
tShowFont.ShowCharInView = (PF_ShowCharInView)_guiShowEng12InView;
tShowFont.GetCharWidth = (PF_GetCharWidth)guiGetEng12Width;
tShowFont.GetCharHeight = (PF_GetCharHeight)guiGetEng12Height;
tShowFont.GetCharBitmap = (PF_GetCharBitmap)guiGetEng12Bitmap;
tShowFont.ShowWord = (PF_ShowWord)guiShowBIG12Word;
tShowFont.ShowWordInView = (PF_ShowWordInView)_guiShowBIG12WordInView;
tShowFont.GetWordWidth = (PF_GetWordWidth)guiGetBIG12WordWidth;
tShowFont.GetWordHeight = (PF_GetWordHeight)guiGetBIG12WordHeight;
tShowFont.GetWordBitmap = (PF_GetWordBitmap)guiGetBIG12Bitmap;
guiSetFontOps( FONT_ENG12_BIG12, tShowFont);
// 设置12点阵普通繁体黑体
tShowFont.ShowChar = (PF_ShowChar)guiShowEng12HT;
tShowFont.ShowCharInView = (PF_ShowCharInView)_guiShowEng12HTInView;
tShowFont.GetCharWidth = (PF_GetCharWidth)guiGetEng12HTWidth;
tShowFont.GetCharHeight = (PF_GetCharHeight)guiGetEng12HTHeight;
tShowFont.GetCharBitmap = (PF_GetCharBitmap)guiGetEng12HTBitmap;
tShowFont.ShowWord = (PF_ShowWord)guiShowGB12Word;
tShowFont.ShowWordInView = (PF_ShowWordInView)_guiShowBIG12WordInView;
tShowFont.GetWordWidth = (PF_GetWordWidth)guiGetBIG12WordWidth;
tShowFont.GetWordHeight = (PF_GetWordHeight)guiGetBIG12WordHeight;
tShowFont.GetWordBitmap = (PF_GetWordBitmap)guiGetBIG12Bitmap;
guiSetFontOps( FONT_ENGHT12_BIG12, tShowFont);
// 设置当前字体
langType = guiQueryLanguageType();
if(langType==LANGUAGE_CHT)
guiSetFont(FONT_ENG12_BIG12);
else if (langType==LANGUAGE_ENG)
#ifdef _LANGUAGE_CHT
guiSetFont(FONT_ENG12_BIG12);
#else
guiSetFont(FONT_ENG12_GB12);
#endif
else
guiSetFont(GUI_DEFAULT_FONT);
#ifdef GUI_FONTEX
guiFontEx_Init(); // 初始化自定义字管理模块
#endif
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -