[mw_shl_code=c,true]int main(void)
{
BSP_Init();
f_mount(0,&fs);
GUI_SetBkColor(GUI_BLUE);
GUI_Clear();
_ShowXBF();
GUI_UC_SetEncodeUTF8();
GUI_SetDefaultFont(&XBF_Font);
GUI_DispString("\n hello");
GUI_DispString("\n 你好");
// OSInit();
// OSTaskCreate(START_UP,
// (void *)0,
// &startup_task_stk[START_UP_STK_SIZE-1],
// START_UP_PRIO);
// OSStart();
}
int _cbGetData(U32 Off, U16 NumBytes, void * pVoid, void * pBuffer)
{
FIL *FontFile;
FRESULT result;
UINT bw;
FontFile = (FIL *)pVoid;
result =f_lseek(FontFile, Off);
if (result != FR_OK)
{
return 1;
}
result = f_read(FontFile, pBuffer, NumBytes, &bw);
if (result != FR_OK)
{
return 1;
}
return 0;
}
void _ShowXBF(void)
{
FRESULT result;
result = f_open(&Fontfile, "zj.xbf", FA_OPEN_EXISTING | FA_READ |FA_OPEN_ALWAYS);
if (result != FR_OK)
{
return;
}
//
// Create XBF font
//
GUI_XBF_CreateFont(&XBF_Font, // Pointer to GUI_FONT structure in RAM(3)
&XBF_Data, // Pointer to GUI_XBF_DATA structure in RAM
GUI_XBF_TYPE_PROP_AA4_EXT, // Font type to be created
_cbGetData, // Pointer to callback function
&Fontfile); // Pointer to be passed to GetData function
}
[/mw_shl_code]
中文显示成下面那个样子。。那个大神知道为什么。。求解释
|