Announcement

Collapse
No announcement yet.

Console Fonts PBCC 5.01

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Console Fonts PBCC 5.01

    Can you control font size or attribute such as bold italic etc in the console window?

    PBCC 5.01

    #2
    To control the font that the console window uses you need to right-click on the console windows title bar and select properties then the font tab. Another option is to use a product called Console tools by Perfect Sync Software (http://www.powerbasic.com/products/contools/) has a utility that can be ran before you run your actual console application to set the console's font.

    Console tools does this by changing the systems registry (I am guessing that it does), if you are comfortable changing the registry programatically, here are the registry keys that control the console font and size.

    The Console key contains several subkeys that define screen size and buffer size for character-based screens in Windows NT. These subkeys appear under the following Registry path:

    HKEY_CURRENT_USER\Console\subkeyNames

    The Command Prompt subkey does not appear unless the current user has changed the screen colors or font for the command prompt and also checked the Save Configuration options. Use the commands on the Control menu in the command prompt to change these values.

    Code:
    Console subkey          Default value entries
    ------------------------------------------
    
    Command Prompt         FontFamily=0x30
    (All data types        FontSize=0xc0008
    are REG_DWORD)         FullScreen=0x1
                           PopupColors=0xf5
                           QuickEdit=0
                           ScreenBufferSize=0x190050
                           ScreenColors=0x9f
                           WindowsPosition=0x150004
                           WindowSize=0x190050
    Configuration          CommandRecallBufferSize=50
    (All data types        FillAttr=0x07
    are REG_SZ)            ScreenBufferColumns=80
                           ScreenBufferRows=25
                           WindowColumns=80
                           WindowRows=25
    Introducing            FullScreen=0x1
    Windows NT
    Microsoft QBASIC       FullScreen0x1
    If you want to use a specific font or color, you might consider using a graphic window instead of the console window, which will let you use any font, at any angle, and at any color. With the new graphic input statements in version 5, this can be done very easily.
    Sincerely,

    Steve Rossell
    PowerBASIC Staff

    Comment


      #3
      > Console tools does this by changing the systems registry
      > (I am guessing that it does),

      FWIW, it depends on the Windows version. Some versions of Windows use the registry, others don't. CWC (a utility program that is included with Console Tools) is designed to detect the Windows version and automatically configure the console font accordingly.

      -- Eric Pearson, Perfect Sync, Inc.
      "Not my circus, not my monkeys."

      Comment


        #4
        Graphic Console Menu

        Charles,

        Go the graphic way, you will never regret it.
        Old QB45 Programmer

        Comment


          #5
          FWIW, it depends on the Windows version. Some versions of Windows use the registry, others don't. CWC (a utility program that is included with Console Tools) is designed to detect the Windows version and automatically configure the console font accordingly.
          Thanks Eric. You are correct this will only work on NT based systems and not on 95, 98, or ME. I do not know how it is done on those OS's, which is a good reason to purchase Console Tools.
          Sincerely,

          Steve Rossell
          PowerBASIC Staff

          Comment


            #6
            I do not know how [changing fonts is done] on those OS's, which is a good reason to purchase Console Tools.
            ... or learn how to create GUI applications?
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


              #7
              For those who don't know about setting up the console using shortcuts:

              In XP, Vista and Win7, you can create shortcuts for your console EXEs that lets you choose the background color, font size, fonts, etc... XP and Vista has Raster and Lucide Console fonts you can choose. Win7 has an extra one called Consolas. Its sizes go all the way up to 72 points like the Lucida Console. The Raster's sizes has jumped up to 10x20 starting with Vista.

              It won't do Italics, only sizes and a couple of fonts.

              To create a Shortcut, just right click on your EXE and click on Create a Shortcut.

              After you create one of these Shortcuts, you can right click on them and go to properties to make the necessary changes. The changes will stick for that EXE as long as you use that shortcut. If you don't use the Shortcut for the program it was created for, you will get the default console settings.
              Last edited by Jerry Fielden; 17 Sep 2009, 11:36 PM.

              Comment


                #8
                SetCurrentConsoleFontEx in Vista

                For use with Vista an API function SetCurrentConsoleFontEx
                See reference information about the SetCurrentConsoleFontEx function, which sets extended information about the current console font.

                was added, which seems to allow configuration of the console
                font by the application.

                However, as i do not use Vista i never actually used this function.

                Arie Verheul

                Comment

                Working...
                X
                😀
                🥰
                🤢
                😎
                😡
                👍
                👎