axyd icon

C++ Console Font Size

axyd | PRO | 10/13/16 06:26:00 AM UTC | 0 ⭐ | 741 👁️ | Never ⏰ | []
C++ |

490 B

|

None

|

0 👍

/

0 👎

#include <windows.h>
#include <cwchar>
 
 
        CONSOLE_FONT_INFOEX cfi;
        cfi.cbSize = sizeof(cfi);
        cfi.nFont = 0;
        cfi.dwFontSize.X = 0;                   // Width of each character in the font
        cfi.dwFontSize.Y = 24;                  // Height
        cfi.FontFamily = FF_DONTCARE;
        cfi.FontWeight = FW_NORMAL;
        std::wcscpy(cfi.FaceName, L"Consolas"); // Choose your font
        SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), FALSE, &cfi);
        std::cout << "Font: Consolas, Size: 24\n";

Comments