Advertisement
axyd

C++ Console Font Size

Oct 13th, 2016
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <windows.h>
  2. #include <cwchar>
  3.  
  4.  
  5.         CONSOLE_FONT_INFOEX cfi;
  6.         cfi.cbSize = sizeof(cfi);
  7.         cfi.nFont = 0;
  8.         cfi.dwFontSize.X = 0;                   // Width of each character in the font
  9.         cfi.dwFontSize.Y = 24;                  // Height
  10.         cfi.FontFamily = FF_DONTCARE;
  11.         cfi.FontWeight = FW_NORMAL;
  12.         std::wcscpy(cfi.FaceName, L"Consolas"); // Choose your font
  13.         SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), FALSE, &cfi);
  14.         std::cout << "Font: Consolas, Size: 24\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement