#include<Windows.h>//必须包含这个头
#include<iostream>
using namespace std;
int main() {
HANDLE hOutPut = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_FONT_INFOEX consoleCurrentFontEx;
consoleCurrentFontEx.cbSize = sizeof(CONSOLE_FONT_INFOEX);
consoleCurrentFontEx.nFont = 0;
consoleCurrentFontEx.dwFontSize.X = 30;//是字体的宽度
consoleCurrentFontEx.dwFontSize.Y = 50;//字体的高度
consoleCurrentFontEx.FontFamily = TMPF_VECTOR;
consoleCurrentFontEx.FontWeight = 400;//字体的粗细(正常字体400 加粗700)
wcscpy_s(consoleCurrentFontEx.FaceName, __TEXT(“Courier”));
SetCurrentConsoleFontEx(hOutPut, FALSE, &consoleCurrentFontEx);
cout << “现在字体的大小是这样的:!Hello World” << endl;
return 0;
}