Increase Font Size Or Bold???

This is a discussion on Increase Font Size Or Bold??? within the C++ Programming forums, part of the General Programming Boards category; I want to know HOW to increase the font size or to make the font bold. I've searched this forum ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    193

    Increase Font Size Or Bold???

    I want to know HOW to increase the font size or to make the font bold. I've searched this forum and all I read was:

    "Yes, you can do it."
    "No, it's not possible."

    Well if you can do it, then HOW do you do it. That's what most of the threads were asking, but people were saying if it actually could be done or not. I want to know HOW to do it, NOT if it CAN be done or not.

  2. #2
    unleashed alphaoide's Avatar
    Join Date
    Sep 2003
    Posts
    696
    by font you mean the text output on console window?
    source: compsci textbooks, cboard.cprogramming.com, world wide web, common sense

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    193
    Yes. I'm sorry if I didn't clearly state that.

  4. #4
    unleashed alphaoide's Avatar
    Join Date
    Sep 2003
    Posts
    696
    source: compsci textbooks, cboard.cprogramming.com, world wide web, common sense

  5. #5
    Registered User
    Join Date
    Aug 2004
    Posts
    193
    Thanks for the info, but when I put in:

    Code:
    void CMyConsoleClass::SetTextBold()
    {
        // hi-white on black 
        SetConsoleTextAttribute ( m_hConsole,
                                  FOREGROUND_RED |
                                    FOREGROUND_GREEN |
                                    FOREGROUND_BLUE |
                                    FOREGROUND_INTENSITY );
    }
    it doesn't set anything bold and returns an error:

    syntax error before '::' token

  6. #6
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Did you create a CMyConsoleClass class?

  7. #7
    Registered User
    Join Date
    Aug 2004
    Posts
    193
    I'm pretty sure. I want to have certain text bold and other text plain.

  8. #8
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,806
    Why not check out good ol adrianxw's site on consoles hes the man
    http://www.adrianxw.dk/SoftwareSite/index.html
    Woop?

  9. #9
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    So somewhere in your source file you have
    Code:
    class CMyConsoleClass {
      public:
        void SetTextBold();
      /* other stuff here */
    };
    If you don't you need to create one.

  10. #10
    unleashed alphaoide's Avatar
    Join Date
    Sep 2003
    Posts
    696
    Code:
    #include <windows.h>
    #include <iostream>
    
    int main( void )
    {
        HANDLE m_hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
        SetConsoleTextAttribute ( m_hConsole,
                                  FOREGROUND_RED |
                                  FOREGROUND_GREEN |
                                  FOREGROUND_BLUE |
                                  FOREGROUND_INTENSITY );
    
        std::cout << "Whassupp\n";
    
        SetConsoleTextAttribute ( m_hConsole, 
                                  BACKGROUND_RED |
                                  BACKGROUND_GREEN |
                                  BACKGROUND_BLUE );
    
        std::cout << "I mean, how you doin?\n";
    
        SetConsoleTextAttribute ( m_hConsole, 
                                  FOREGROUND_BLUE |
                                  FOREGROUND_INTENSITY|
                                  BACKGROUND_GREEN|
                                  BACKGROUND_INTENSITY);
    
        std::cout << "Dude, where's my car? DUDE??\n";
    
        SetConsoleTextAttribute ( m_hConsole,
                                  FOREGROUND_RED |
                                  FOREGROUND_GREEN |
                                  FOREGROUND_BLUE );
    
        std::cout << "Credit: google, msdn.microsoft.com\n";
    
        return 0;
    }
    source: compsci textbooks, cboard.cprogramming.com, world wide web, common sense

  11. #11
    Registered User
    Join Date
    Aug 2004
    Posts
    193
    Thanks for all of your help. I got it working now how I want it to work.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Invalid conversion from 'void*' to 'BYTE' help
    By bikr692002 in forum C++ Programming
    Replies: 9
    Last Post: 02-22-2006, 10:27 AM
  2. increase array size?
    By rodrigorules in forum C Programming
    Replies: 3
    Last Post: 09-18-2005, 12:15 PM
  3. Changing font size of CStatic
    By earth_angel in forum Windows Programming
    Replies: 2
    Last Post: 08-12-2005, 10:51 AM
  4. The relation between Font Size & Dialog Units
    By Templario in forum Windows Programming
    Replies: 4
    Last Post: 02-27-2003, 04:32 PM
  5. font size
    By binmoreeeee in forum Windows Programming
    Replies: 1
    Last Post: 11-17-2002, 08:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21