Skip to content

Convert MFC Fonts to c# Fonts

Tulika Shrivastava

Asked Feb 12, 2006, 9:07 PM EST1 answer
Share
LinkedInX

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# and to provide backward compatibility  it is important. Can anyone suggest me a possible workaround for this problem????

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0

    Could you use a generic dll, which could provide you a font's Windows handle? You could then create a System.Drawing.Font object using that handle with FromHfont method of Font class.

    But that doesen't solve the problem with parameters missing... You could use an unmanaged extension that handles your font savings and reading alltogether, i can figure out anything else...

    0