Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Font Color

Font Color

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Richard Andrew x64R Offline
    Richard Andrew x64R Offline
    Richard Andrew x64
    wrote on last edited by
    #1

    How is the color of a font stored and processed? I see that the LOGFONT structure does not have a member for the color, nor does CFont. How does the system keep track of the color of a font?

    The difficult we do right away... ...the impossible takes slightly longer.

    L 1 Reply Last reply
    0
    • Richard Andrew x64R Richard Andrew x64

      How is the color of a font stored and processed? I see that the LOGFONT structure does not have a member for the color, nor does CFont. How does the system keep track of the color of a font?

      The difficult we do right away... ...the impossible takes slightly longer.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      It doesn't; fonts do not have a colour attribute. When writing text to a device context you select the appropriate foreground and background colours that you wish to use.

      Veni, vidi, abiit domum

      Richard Andrew x64R 1 Reply Last reply
      0
      • L Lost User

        It doesn't; fonts do not have a colour attribute. When writing text to a device context you select the appropriate foreground and background colours that you wish to use.

        Veni, vidi, abiit domum

        Richard Andrew x64R Offline
        Richard Andrew x64R Offline
        Richard Andrew x64
        wrote on last edited by
        #3

        Oh I see. I guess it depends upon what brush I use? Thanks, Richard.

        The difficult we do right away... ...the impossible takes slightly longer.

        C _ K 3 Replies Last reply
        0
        • Richard Andrew x64R Richard Andrew x64

          Oh I see. I guess it depends upon what brush I use? Thanks, Richard.

          The difficult we do right away... ...the impossible takes slightly longer.

          C Offline
          C Offline
          Chris Losinger
          wrote on last edited by
          #4

          it's not a brush or pen, there's a GDI function called SetTextColor.

          image processing toolkits | batch image processing

          1 Reply Last reply
          0
          • Richard Andrew x64R Richard Andrew x64

            Oh I see. I guess it depends upon what brush I use? Thanks, Richard.

            The difficult we do right away... ...the impossible takes slightly longer.

            _ Offline
            _ Offline
            _Superman_
            wrote on last edited by
            #5

            For text, the APIs used for color are SetTextColor and SetBkColor.

            «_Superman_»  _I love work. It gives me something to do between weekends.

            _Microsoft MVP (Visual C++) (October 2009 - September 2013)

            Polymorphism in C

            1 Reply Last reply
            0
            • Richard Andrew x64R Richard Andrew x64

              Oh I see. I guess it depends upon what brush I use? Thanks, Richard.

              The difficult we do right away... ...the impossible takes slightly longer.

              K Offline
              K Offline
              koll Zhu
              wrote on last edited by
              #6

              its right

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups