?? unicode.c
字號:
/***********************************************************
描述: 用c語言寫的一個如何從unicode編碼格式的點陣字庫中讀取字符信息(像素寬 +點陣信息)
至于容錯性和效率方面還得使用者自行改善。謝謝您的參閱!作者: wujianguo
日期: 20090516
MSN: wujianguo19@hotmail.com
qq: 9599598
*************************************************************/
#include "..\font.h"
#include "unicode.h"
extern FILE *g_prf;
extern FL_HEADER _fl_header;
extern DWORD g_dwCharInfo;
int ReadFontSection()
{
PFL_HEADER pfl_header = &_fl_header;
ReleaseSection();
pfl_header->pSection = (FL_SECTION_INF *)malloc(pfl_header->nSection*sizeof(FL_SECTION_INF));
if(pfl_header->pSection == NULL)
{
printf("Malloc fail!\n");
return 0;
}
fread(pfl_header->pSection, pfl_header->nSection*sizeof(FL_SECTION_INF), 1, g_prf);
return 1;
}
void ReleaseSection()
{
if(_fl_header.pSection != NULL)
{
free(_fl_header.pSection);
_fl_header.pSection = NULL;
}
}
// 獲取字符的像素寬度
DWORD ReadCharDistX_U(WORD wCode)
{
DWORD offset ;
int i;
g_dwCharInfo = 0;
for(i = 0;i<_fl_header.nSection;i++)
{
if(wCode >= _fl_header.pSection[i].First && wCode <= _fl_header.pSection[i].Last)
break;
}
if(i >= _fl_header.nSection)
return 0;
offset = _fl_header.pSection[i].OffAddr+ FONT_INDEX_TAB_SIZE*(wCode - _fl_header.pSection[i].First );
fseek(g_prf, offset, SEEK_SET);
fread(&g_dwCharInfo, sizeof(DWORD), 1, g_prf);
return GET_FONT_WIDTH(g_dwCharInfo);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -