简体   繁体   中英

Change Windows Terminal font programmatically

I want to write a 2D chess program. It does not require much user input so it will use only the Windows Console, not any GUI. I know how to access the Windows Console API and change its font using Assembly language or C++. Using the same method for Windows Terminal does not work as it is written to behave as font agnostic terminal. However, in Windows Terminal you can set the font to your liking through the settings. I want to change the Windows Terminal font from the outside, before or during when Windows Terminal launches. I know all Windows Terminal settings are stored in a JSON file so I can manipulate it before lanching. I'm looking for a more straight forward approach like a command line option or a WINAPI call. I could not find any. Is there any way to programmaticaly change the Windows Terminal font?

Have a look at SetCurrentConsoleFontEx()

Sets extended information about the current console font.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM