I'm in the process of creating a rougelike and to assure my game displays correctly I am wanting to change the console font and font size at runtime.
I am very noob to programming and c# so I'm hoping this can be explained in a way I or anyone else can easily implement.
This resource list the full syntax of the CONSOLE_FONT_INFOEX structure:
typedef struct _CONSOLE_FONT_INFOEX {
ULONG cbSize;
DWORD nFont;
COORD dwFontSize;
UINT FontFamily;
UINT FontWeight;
WCHAR FaceName[LF_FACESIZE];
} CONSOLE_FONT_INFOEX, *PCONSOLE_FONT_INFOEX;
Specifically I'm wanting to change the console font to NSimSum and font size to 32 at runtime.
EDIT 1: Could I have it explained how to use the SetCurrentConsoleFontEx function from this post. I don't understand what context the function needs to be in. I tried Console.SetCurrentConsoleFontEx
but vs gave me no options.
EDIT 2: this forum post seems to detail a simple method of changing font size but is it specific to c++?
void setFontSize(int FontSize)
{
CONSOLE_FONT_INFOEX info = {0};
info.cbSize = sizeof(info);
info.dwFontSize.Y = FontSize; // leave X as zero
info.FontWeight = FW_NORMAL;
wcscpy(info.FaceName, L"Lucida Console");
SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), NULL, &info);
}