Temple of The Roguelike Forums

Development => Programming => Topic started by: Trr1ppy on October 30, 2017, 02:57:40 PM

Title: C# change font and font size at runtime
Post by: Trr1ppy on October 30, 2017, 02:57:40 PM
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. Specifically font NSimSum and font size 32.
I am very new to programming and c# so I'm hoping this can be explained simply.

This page (https://docs.microsoft.com/en-us/windows/console/console-font-infoex) list the full syntax of the CONSOLE_FONT_INFOEX structure:

Code: [Select]
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;

But I have no idea how to implement this into my existing code.
Title: Re: C# change font and font size at runtime
Post by: Krice on October 31, 2017, 07:12:41 AM
Try google search, Sherlock. I found something from third hit with "C# change console font". But I think it's actually not a good idea to change it manually. Just let it be the default and users can anyway change the font from window properties as usual.