|
请问在模拟器中使用FontCvt在 emwin 模拟器中显示汉字时异常,根本无法显示,在开发板上也无法显示:
关键代码:
==================================================================
extern GUI_CONST_STORAGE GUI_FONT GUI_FontChinese;
extern GUI_CONST_STORAGE unsigned char acGUI_FontChinese_7801[72];
GUI_UC_SetEncodeUTF8();
GUI_SetFont(&GUI_FontChinese);
GUI_SetColor(GUI_WHITE);
GUI_SetTextMode(GUI_TM_TRANS);
GUI_DispStringHCenterAt(acGUI_FontChinese_7801, 10, 10);
==================================================================
/*********************************************************************
* SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
* www.segger.com *
**********************************************************************
* *
* C-file generated by *
* *
* Font Converter (Demoversion) for emWin version 5.30 *
* Compiled Jun 30 2015, 14:58:45 *
* *
* (c) 1998 - 2015 Segger Microcontroller GmbH & Co. KG *
* *
**********************************************************************
* *
* Source file: Chinese.c *
* Font: 宋体 *
* Height: 24 *
* *
**********************************************************************
* *
* Initial font height: 24 *
* Range disabled: 0000 - FFFF *
* Range enabled: 7801 - 7801 *
* *
**********************************************************************
*/
#include "GUI.h"
#ifndef GUI_CONST_STORAGE
#define GUI_CONST_STORAGE const
#endif
/* The following line needs to be included in any file selecting the
font.
*/
extern GUI_CONST_STORAGE GUI_FONT GUI_FontChinese;
/* Start of unicode area <CJK Unified Ideographs> */
GUI_CONST_STORAGE unsigned char acGUI_FontChinese_7801[ 72] = { /* code 7801 */
XX__X___,__XXXXXX,X_X_X__X,
__X__XX_,X_X_XXX_,XX_XX_XX,
X_X__XXX,XXX__X__,_______X,
_X___XX_,XX______,X__X_XX_,
__XXXXX_,__X_X_XX,___XXXX_,
__X_XXX_,X___X___,XXXXXXXX,
XXX_X___,__X__X_X,_X_X_XXX,
__X____X,_X__X_XX,____XX_X,
_XXX_XX_,X_XX_XX_,_X___XX_,
XXXXXX_X,_______X,X_XX____,
_X_X_XX_,_X___X__,__XXX___,
X__XXXX_,_XX___XX,X_XXXX_X,
_X__XX__,X_XX_X__,XX_XX_X_,
_XXXX_XX,XX_XXXX_,_X__X__X,
_X_XXXXX,___XX_X_,__X___XX,
X_X__X_X,X___XX_X,____XX_X,
_XX_____,_XX_XX_X,X_X__X__,
XX_XXXX_,X_XXX_XX,XX______,
X_X___XX,X__XX___,X_XX____,
X__XX___,X__X___X,_X_XX__X,
__XXX_XX,X_X___X_,XXXX____,
__XXXXX_,___X_X_X,_X__XXX_,
_XX_X_X_,XXX___X_,X_X_X___,
XX___X_X,XXXX__X_,X_XXXXXX};
GUI_CONST_STORAGE GUI_CHARINFO GUI_FontChinese_CharInfo[1] = {
{ 24, 24, 1, acGUI_FontChinese_7801 } /* code 7801 */
};
GUI_CONST_STORAGE GUI_FONT_PROP GUI_FontChinese_Prop1 = {
0x7801 /* first character */
,0x7801 /* last character */
,&GUI_FontChinese_CharInfo[ 0] /* address of first character */
,(GUI_CONST_STORAGE GUI_FONT_PROP *)0 /* pointer to next GUI_FONT_PROP */
};
GUI_CONST_STORAGE GUI_FONT GUI_FontChinese = {
GUI_FONTTYPE_PROP /* type of font */
,24 /* height of font */
,24 /* space of font y */
,1 /* magnification x */
,1 /* magnification y */
,{&GUI_FontChinese_Prop1}
,21 /* Baseline */
,11 /* Height of lowercase characters */
,16 /* Height of capital characters */
};
我用的是第十八章的方法,因为我只需要用到几个汉字,不需要整个字库,所以想自己提取。
我的文件格式也是UTF-8,我目前只提取了一个“码”字。
请问还有其他简单的方法能满足我的需求吗? |
|