⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 font.cpp

📁 vt100终端仿真程序
💻 CPP
字号:
#include "stdafx.h"
#include "font.h"

extern int g_iArrPara[50]; //函数参数组 g_iArrPara[0] 存放参数个数,g_iArrPara[1],g_iArrPara[2]...为相应参数 
struct CharRowProp struCharProp;

//?

//行属性	
//ESC #3	设置当前行为倍宽倍高(上半部分)
int SetRowPropDbWHTop()
{
	struCharProp.cRowWHPorp=1;
	return 0;
}

//ESC #4	设置当前行为倍宽倍高(下半部分)
int SetRowPropDbWHBottom()
{
	struCharProp.cRowWHPorp=2;;
	return 0;
}

//ESC #5	设置当前行为单宽单高
int SetRowPropSingleWH()
{
	struCharProp.cRowWHPorp=0;
	return 0;
}

//ESC #6	设置当前行为倍宽单高
int SetRowPropDoubleSingleWH()
{
	struCharProp.cRowWHPorp=3;
	return 0;
}


//字符属性
//CSI Ps;Ps;...m	设置字符显示属性,Ps代表某种字符属性,见表3.1.3.3-2
int SetCharProp()
{
	int i;
	if (g_iArrPara[0]==0)
	{
			struCharProp.iLight=0;
			struCharProp.iUnderLine=0;
			struCharProp.iFlash=0;
			struCharProp.iDisplay=0;
			struCharProp.iPassword=0;
			struCharProp.cCharWHProp=0;
			return 0;
	}
	for (i=1;i<=g_iArrPara[0];i++)
	{
		switch (g_iArrPara[i])
		{
		case 0:
			struCharProp.iLight=0;
			struCharProp.iUnderLine=0;
			struCharProp.iFlash=0;
			struCharProp.iDisplay=0;
			struCharProp.iPassword=0;
			struCharProp.cCharWHProp=0;
			break;
		case 1:
			struCharProp.iLight=1;break;
		case 3:
			struCharProp.iPassword=1;break;
		case 4:
			struCharProp.iUnderLine=1;break;
		case 5:
			struCharProp.iFlash=1;break;
		case 6:
			struCharProp.iPassword=1;break;
		case 7:
			struCharProp.iDisplay=1;break;
		case 8:
			struCharProp.iPassword=1;break;
		case 9:
			struCharProp.cCharWHProp=1;break;
		case 10:
			struCharProp.cCharWHProp=2;break;
		case 13:
			struCharProp.cCharWHProp=3;break;
		case 14:
			struCharProp.cCharWHProp=4;break;
		case 16:
			struCharProp.cCharWHProp=5;break;
		case 22:
			struCharProp.iLight=0;break;
		case 23:
			struCharProp.cCharWHProp=0;
			break;
		case 24:
			struCharProp.iUnderLine=0;break;
		case 25:
			struCharProp.iFlash=0;break;
		case 27:
			struCharProp.iDisplay=0;break;
		case 28:
			struCharProp.iPassword=0;break;
		default:break;
		}	
	}
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -