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. On Using EM_SETCHARFORMAT and GetCharABCWidths with courier new

On Using EM_SETCHARFORMAT and GetCharABCWidths with courier new

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
2 Posts 2 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.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    Hi I am used to figuring character formatting from the mainframe world where everything is a byte, towards that and I would like to use courier new in my rich edit. can I use

    EM_SETCHARFORMAT

    setting courier new of course I would probably have to use CClientDC to get the device context of the rich edit and then GetCharABCWidths Does this make any sense ?

    L 1 Reply Last reply
    0
    • F ForNow

      Hi I am used to figuring character formatting from the mainframe world where everything is a byte, towards that and I would like to use courier new in my rich edit. can I use

      EM_SETCHARFORMAT

      setting courier new of course I would probably have to use CClientDC to get the device context of the rich edit and then GetCharABCWidths Does this make any sense ?

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

      ForNow wrote:

      Does this make any sense ?

      Not really. Everything on a PC is also a byte (or a word ...). The only time the format of a character has any real relevance is when you display it on some output device. So when writing to your device context, you must first create a font and select it into the DC. See https://msdn.microsoft.com/en-us/library/w6196kz3.aspx[^] for some more details. See also http://www.functionx.com/win32/Lesson15.htm[^] for a sample using Win32, but you should be able to get enough information to use that in MFC.

      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