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. Fonts in CRichEditCtrl

Fonts in CRichEditCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
csharpcomregextutorialquestion
5 Posts 3 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.
  • J Offline
    J Offline
    Jason Hooper
    wrote on last edited by
    #1

    I have a class derived from CRichEditCtrl, and am attempting to set its default font by filling CHARFORMAT's yHeight and calling CRichEditCtrl::SetDefaultCharFormat, but I can't seem to find an actual way to convert my value (which is in points) to the value it needs ("twips", apparently) to match the size of the font when used in other areas of my client screen (multiplying the pts value by ten causes it to be around the same size, but it seems bold, for example). Can anybody pass down a little wisdom on this idea? I'm at somewhat of an impasse in that branch of my project. Thanks. - Jason (SonorkID 100.611) The Code Project - Orange makes the art grow fonder

    M M 2 Replies Last reply
    0
    • J Jason Hooper

      I have a class derived from CRichEditCtrl, and am attempting to set its default font by filling CHARFORMAT's yHeight and calling CRichEditCtrl::SetDefaultCharFormat, but I can't seem to find an actual way to convert my value (which is in points) to the value it needs ("twips", apparently) to match the size of the font when used in other areas of my client screen (multiplying the pts value by ten causes it to be around the same size, but it seems bold, for example). Can anybody pass down a little wisdom on this idea? I'm at somewhat of an impasse in that branch of my project. Thanks. - Jason (SonorkID 100.611) The Code Project - Orange makes the art grow fonder

      M Offline
      M Offline
      Moak
      wrote on last edited by
      #2

      how about using yHeight=points*12 and dwEffects=0 ?

      1 Reply Last reply
      0
      • J Jason Hooper

        I have a class derived from CRichEditCtrl, and am attempting to set its default font by filling CHARFORMAT's yHeight and calling CRichEditCtrl::SetDefaultCharFormat, but I can't seem to find an actual way to convert my value (which is in points) to the value it needs ("twips", apparently) to match the size of the font when used in other areas of my client screen (multiplying the pts value by ten causes it to be around the same size, but it seems bold, for example). Can anybody pass down a little wisdom on this idea? I'm at somewhat of an impasse in that branch of my project. Thanks. - Jason (SonorkID 100.611) The Code Project - Orange makes the art grow fonder

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        From the CHARFORMAT docs -

        yHeight

        Character height, in twips (1/1440 of an inch or 1/20 of a printer's point).

        So 20 twips == 1 point. --Mike-- The Internet is a place where absolutely nothing happens.   -- Strong Bad 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

        J 2 Replies Last reply
        0
        • M Michael Dunn

          From the CHARFORMAT docs -

          yHeight

          Character height, in twips (1/1440 of an inch or 1/20 of a printer's point).

          So 20 twips == 1 point. --Mike-- The Internet is a place where absolutely nothing happens.   -- Strong Bad 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

          J Offline
          J Offline
          Jason Hooper
          wrote on last edited by
          #4

          I tried yours and Moak's suggestions, but the text is still in bold. Any further ideas? Thanks for helping, and especially for taking the time to go and dig that up from the MSDN. - Jason (SonorkID 100.611) The Code Project - Orange makes the art grow fonder

          1 Reply Last reply
          0
          • M Michael Dunn

            From the CHARFORMAT docs -

            yHeight

            Character height, in twips (1/1440 of an inch or 1/20 of a printer's point).

            So 20 twips == 1 point. --Mike-- The Internet is a place where absolutely nothing happens.   -- Strong Bad 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

            J Offline
            J Offline
            Jason Hooper
            wrote on last edited by
            #5

            Nevermind, thanks.. got it :) - Jason (SonorkID 100.611) The Code Project - Orange makes the art grow fonder

            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