91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

現在的UC/GUI的源程序只能實現部分英文字庫,但我們中國人開發項目常常要用中國字,網上關于實現漢字的方法的文章太多了,隨便可以找到,但是那都是將少量的字庫文件存放在片內的FLASH,一旦在不確定漢字使用范圍的時候那就麻煩了,要將整個字庫文件編進去的話那個頭就太大了,因此只能外加片外FLASH了,這樣就要修改UC/GUI的源碼了。

資源截圖

代碼片段和文件信息

/*
*********************************************************************************************************
*????????????????????????????????????????????????uC/GUI
*????????????????????????Universal?graphic?software?for?embedded?applications
*
*???????????????????????(c)?Copyright?2002?Micrium?Inc.?Weston?FL
*???????????????????????(c)?Copyright?2002?SEGGER?Microcontroller?Systeme?GmbH
*
*??????????????礐/GUI?is?protected?by?international?copyright?laws.?Knowledge?of?the
*??????????????source?code?may?not?be?used?to?write?a?similar?product.?This?file?may
*??????????????only?be?used?in?accordance?with?a?license?and?should?not?be?redistributed
*??????????????in?any?way.?We?appreciate?your?understanding?and?fairness.
*
----------------------------------------------------------------------
File????????:?GUICharP.C
Purpose?????:?Implementation?of?Proportional?fonts
---------------------------END-OF-HEADER------------------------------
*/

#include????????????/*?needed?for?definition?of?NULL?*/
#include?“GUI_Private.h“
?
/*********************************************************************
*
*???????Static?code

*
**********************************************************************
*/
//字模數據的暫存數組以單個字模的最大字節數為設定值?
#define?BYTES_PER_FONT?64?
static?U8?GUI_FontDataBuf[BYTES_PER_FONT];

/*********************************************************************
*
*???????GUIPROP_FindChar
*/
static?const?GUI_FONT_PROP?GUI_UNI_PTR?*?GUIPROP_FindChar(const?GUI_FONT_PROP?GUI_UNI_PTR*?pProp?U16P?c)?{
??for?(;?pProp;?pProp?=?pProp->pNext)?{
????if?((c>=pProp->First)?&&?(c<=pProp->Last))
??????break;
??}
??return?pProp;
}

/*********************************************************************
*
*???????Public?code
*
**********************************************************************
*/
/*********************************************************************
*
*???????GUIPROP_DispChar
*
*?Purpose:
*???This?is?the?routine?that?displays?a?character.?It?is?used?by?all
*???other?routines?which?display?characters?as?a?subroutine.
*/
void?GUIPROP_DispChar(U16P?c)?{
??int?BytesPerLine;
U8?BytesPerFont;?
U32?baseoft;?

??GUI_DRAWMODE?DrawMode?=?GUI_Context.TextMode;
??const?GUI_FONT_PROP?GUI_UNI_PTR?*?pProp?=?GUIPROP_FindChar(GUI_Context.pAFont->p.pProp?c);
??if?(pProp)?{
????GUI_DRAWMODE?OldDrawMode;
const?GUI_CHARINFO?GUI_UNI_PTR?*?pCharInfo;
if(GUI_Context.pAFont?==?&GUI_FontHZ_SimHei_20)
{
pCharInfo?=?pProp->paCharInfo;

base?=?(U32)pProp->paCharInfo->pData;
???? BytesPerFont?=?GUI_Context.pAFont->YSize?*?pProp->paCharInfo->BytesPerLine;?//每個字模的數據字節數?
???? if?(BytesPerFont?>?BYTES_PER_FONT)
???? {
???? BytesPerFont?=?BYTES_PER_FONT;
???? }?
???? if?(c????? {?
???? oft?=?base?+?(c?-?0x20)?*?BytesPerFont;?
???? }
???? else?//中文字符地址偏移算法?
???? {
???? if((c>>8)?>=?0xb0)
oft?=?base?+?(((c>>8)?-?0xa1?-?6)?*?94?+?((c&0xff)?-?0xa1))?*?B

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????17899??2010-12-26?17:16??SimHei_20.c

?????文件???????5889??2010-12-27?09:54??GUICharP.c

?????文件????????239??2010-12-31?10:28??readme.txt

-----------?---------??----------?-----??----

????????????????24027????????????????????3


評論

共有 條評論