Для этой цели я написал следующую функцию:
Код: Выделить всё
void setConsoleFont() {
CONSOLE_FONT_INFOEX consoleFontInfo = { 0 };
consoleFontInfo.cbSize = sizeof(CONSOLE_FONT_INFOEX);
consoleFontInfo.dwFontSize.X = 18;
consoleFontInfo.dwFontSize.Y = 18;
consoleFontInfo.FontWeight = FW_BOLD;
consoleFontInfo.FontFamily = FF_MODERN;
wcscpy_s(consoleFontInfo.FaceName, L"Courier Regular");
consoleFontInfo.nFont = 0;
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
if(handle != INVALID_HANDLE_VALUE)
if (SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), true, &consoleFontInfo)) {
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79025109/how-to-change-my-font-properties-using-c-program-including-window-h-file[/url]