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#
  4. Convert MFC Fonts to c# Fonts

Convert MFC Fonts to c# Fonts

Scheduled Pinned Locked Moved C#
c++csharphelpquestion
3 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.
  • T Offline
    T Offline
    Tulika Shrivastava
    wrote on last edited by
    #1

    hi, I have an application developed in MFC( VC++ 6.0 ) where the information all the parameters of CreateFont function of CFont is stored in a file. Now I am rewriting the whole application in c#. But I am not able to map all the paramters of CreateFont to the Font class of c# :doh:and to provide backward compatibility it is important. Can anyone suggest me a possible workaround for this problem:confused:????

    C 1 Reply Last reply
    0
    • T Tulika Shrivastava

      hi, I have an application developed in MFC( VC++ 6.0 ) where the information all the parameters of CreateFont function of CFont is stored in a file. Now I am rewriting the whole application in c#. But I am not able to map all the paramters of CreateFont to the Font class of c# :doh:and to provide backward compatibility it is important. Can anyone suggest me a possible workaround for this problem:confused:????

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Tulika Shrivastava wrote:

      Can anyone suggest me a possible workaround for this problem

      It would be helpful to understand the format of the file. ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

      T 1 Reply Last reply
      0
      • C Colin Angus Mackay

        Tulika Shrivastava wrote:

        Can anyone suggest me a possible workaround for this problem

        It would be helpful to understand the format of the file. ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

        T Offline
        T Offline
        Tulika Shrivastava
        wrote on last edited by
        #3

        hi, The information about the font is stored in the follwing format: 1. LoByte (Point size for Font) 2. LoByte (Point size for Font) 3. LoByte(LoWord(Height)) 4. HiByte(LoWord(Height)) 5. LoByte(HiWord(Height)) 6. HiByte(HiWord(Height)) 7. LoByte(LoWord(Width)) 8. HiByte(LoWord(Width)) 9. LoByte(HiWord(Width)) 10. HiByte(HiWord(Width)) 11. LoByte(LoWord(Escapement)) 12. HiByte(LoWord(Escapement)) 13. LoByte(HiWord(Escapement)) 14. HiByte(HiWord(Escapement)) 15. LoByte(LoWord(Orientation)) 16. HiByte(LoWord(Orientation)) 17. LoByte(HiWord(Orientation)) 18. HiByte(HiWord(Orientation)) 19. LoByte(LoWord(Weight)) 20. HiByte(LoWord(Weight)) 21. LoByte(HiWord(Weight)) 22. HiByte(HiWord(Weight)) 23. Italic(byte) 24. Underline(byte) 25. StrikeOut(byte) 26. CharSet(byte) 27. OutPrecision(byte) 28. ClipPrecision(byte) 29. Quality (byte) 30. PitchAndFamily(byte) 31. Length of face name (L) For Length L following 2 bytes will be repeated 1. LoByte (character of face name) 2. HiByte (character of face name) Here the first inforation i.e.Point size for Font is the value which we get from the CFontDialog::GetSize() function and the rest of the information are the the parameters of the CFont::CreateFont( int nHeight, int nWidth, int nEscapement, int nOrientation, int nWeight, BYTE bItalic, BYTE bUnderline, BYTE cStrikeOut, BYTE nCharSet, BYTE nOutPrecision, BYTE nClipPrecision, BYTE nQuality, BYTE nPitchAndFamily, LPCTSTR lpszFacename ). I am not able to map all these parameters to their corresponding c# values and thus cant open the application developed using the previous version( MFC ) and see the fonts properly.Any suggetions??? -- modified at 4:33 Monday 13th February, 2006

        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