📄 font.c
字号:
void GET_Font_Printer_String(unsigned char *pString)
{
int charSector,charBit,charBit1,charBit0;
int offset;
unsigned char *pOffset;
printf("Get_Font_Printer_String!!\n");
topOffset = 0;
bottomOffset = 0;
while(*pString)
{
// printf("stirng is [%x]\n",*pString);
if(IS_ASCII(pString))
{
offset = *pString;
pOffset = (unsigned char *)(FontAMap + offset);
Change_String(pOffset,PrinterTop,PrinterBottom,EN);
pString++;
}
else
{
charSector = (*pString);
charBit = *(pString + 1);
printf("charSector is [%x] , charBit is [%x]\n",charSector,charBit);
if(charSector >= 0xB0&&charSector <= 0xF7&&charBit >= 0xA1&&charBit <= 0xFE)
{
offset=(94*(charSector-0xB0)+(charBit-0xa1)); //?á???????????
}
else if(charSector >= 0x81&&charSector <= 0xA0&&charBit >= 0x40&&charBit <= 0xFE)
{
if(charBit > 0x7F)
offset=(190*(charSector-0x81)+(charBit-0x41)+6768);
else if(charBit < 0x7F)
offset=(190*(charSector-0x81)+(charBit-0x40)+6768);
else
offset=3758;
}
else if(charSector >= 0xAA&&charSector <= 0xFB&&charBit >= 0x40&&charBit <= 0xA0)
{
offset=(96*(charSector-0xAA)+(charBit-0x40)+12848); //?á???????????
}
else if(charSector >= 0x81&&charSector <= 0x82&&charBit >= 0x30&&charBit <= 0x39)
{
charBit1 = *(pString + 2);
charBit0 = *(pString + 3);
offset = (12600*(charSector-0x81)+1260*(charBit-0x30)+10*(charBit1-0x81)+(charBit0-0x30)+8569);
pString = pString + 2;
}
else
{
offset=3758;
}
printf("string offset is : %d\n",offset);
pOffset = (unsigned char *)(FontCMap + offset);
Change_String(pOffset,PrinterTop,PrinterBottom,CN);
pString += 2;
}
}
topOffset = 0;
bottomOffset = 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -