📄 uieng14ht.c
字号:
#include <uifont.h>
#include <uiEng14HT.h>
#include <uiUtility.h>
#include <uiEng14HT.res>
short guiGetEng14HTHeight()
{
return 14;
}
short guiGetEng14HTWidth(const char ascii)
{
return Eng14HT_Width[ascii];
}
void _guiShowEng14HTInView(TRect *rect, const char ascii, int x, int y, int color, int style)
{
short data, bitOffset, dataOffset;
short rulerData, width;
int i, j, xPos, yPos;
int bkcolor, fgcolor;
dataOffset = Eng14HT_Offset[ascii];
width = Eng14HT_Width[ascii];
bkcolor = (color&0x0000ff00)>>8;
fgcolor = color&0x000000ff;
xPos = x;
yPos = y;
if(style==FONT_TRANSPARENT)
{
for(i=dataOffset; i<dataOffset+width; i++)
{
data = Eng14HT_Data[i];
for(j=0; j<14; j++)
{
rulerData = (0x0001)<<j;
if(data & rulerData)
{
if((xPos>=rect->left)&&(xPos<=rect->right)&&(yPos+j>=rect->top)&&(yPos+j<=rect->bottom))
displayDrawPixel(xPos, yPos+j, fgcolor);
}
}
xPos++;
}
}
else
{
for(i=dataOffset; i<dataOffset+width; i++)
{
data = Eng14HT_Data[i];
for(j=0; j<14; j++)
{
rulerData = (0x0001)<<j;
if((xPos>=rect->left)&&(xPos<=rect->right)&&(yPos+j>=rect->top)&&(yPos+j<=rect->bottom))
{
if(data & rulerData)
displayDrawPixel(xPos, yPos+j, fgcolor);
else
displayDrawPixel(xPos, yPos+j, bkcolor);
}
}
xPos++;
}
}
}
void guiShowEng14HT(HNDL handle, const char ascii, int x, int y, int color, int style)
{
TRect ViewRect;
int iRet, left, top;
int ViewLeft, ViewTop, ViewRight, ViewBottom;
iRet = _guiGetHandleView(handle, &ViewLeft, &ViewTop, &ViewRight, &ViewBottom);
if(iRet!=STATUS_OK)
return;
ViewRect.left = ViewLeft; ViewRect.top = ViewTop;
ViewRect.right = ViewRight; ViewRect.bottom = ViewBottom;
left = x;
top = y;
_guiConvertXY(handle, &left, &top);
_guiShowEng14HTInView(&ViewRect, ascii, left, top, color, style);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -