Thread: How change console default font

  1. #1
    Registered User
    Join Date
    Aug 2013
    Location
    Vila Velha, Brazil
    Posts
    2

    How change console default font

    I found one API to do this, but i don't know use, if anyone can help-me


    API SetCurrentConsoleFontEx
    SetCurrentConsoleFontEx function (Windows)
    Thank you for everything!

  2. #2
    Registered User
    Join Date
    Aug 2013
    Location
    Vila Velha, Brazil
    Posts
    2
    anyone?

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Having searched for the function name, it's pretty easy to find examples of code which use that function.

    Have you tried any of them?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Have you googled for the sample?
    Have you compiled and run found sample?
    Does your sample working not as expected?

    Show your code and explain what is happening not as desired.
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  5. #5
    Registered User MyDoom's Avatar
    Join Date
    Jul 2013
    Posts
    9
    You need to get the console handle for the first argument:
    Code:
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    The second argument can probably be TRUE.

    Notice you need a struct for the third argument:
    Code:
    CONSOLE_FONT_INFOEX cfInfo;
    cfInfo.cbSize = sizeof(CONSOLE_FONT_INFOEX);
    You can fill in the rest of the struct members (remember to use fonts only available in the console).

    Then call the function:
    Code:
    BOOL result = SetCurrentConsoleFontEx(hConsole, TRUE, &cfInfo);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with default font in graphical mode
    By voldemarz in forum C Programming
    Replies: 16
    Last Post: 10-24-2008, 01:30 PM
  2. Set default font for all objects?
    By Dampy in forum Windows Programming
    Replies: 1
    Last Post: 05-31-2008, 05:57 PM
  3. Changing default font in Emacs
    By dra in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 02-26-2008, 02:53 AM
  4. default font
    By larry in forum Windows Programming
    Replies: 2
    Last Post: 02-13-2003, 05:22 AM
  5. setting default font to draw all further controls with
    By alandrums in forum Windows Programming
    Replies: 0
    Last Post: 12-03-2001, 10:31 PM

Tags for this Thread