问题描述
大家好,
我有一个C#应用程序,它使用FontConverter类将Font转换为String并写入文件。
现在,我需要在MFC应用程序中读取此文件并将写入的字体(作为字符串)转换为CFont对象。
简而言之,我需要在MFC中实现以下。
FontConverter fontConverter = new FontConverter();
Font font = fontConverter.ConvertFromInvariantString(fontData)as Font;
任何帮助都将受到高度赞赏。
谢谢,
Kishor
我尝试了什么:
直到现在,我按原样阅读字符串解析为所需的内容。
例如,如果字符串是Monotype Corsiva,15.75pt,style = Bold,Italic我单独解析并创建了CFont对象。 />
还有更好的方法吗?
Hi All,
I have a C# application which converts the Font to String using FontConverter class and writes to a file.
Now, i need to read this file in MFC application and convert the written Font (as string) to CFont object.
In short, i need to implement the below in MFC.
FontConverter fontConverter = new FontConverter();
Font font = fontConverter.ConvertFromInvariantString(fontData) as Font;
Any help would be highly appreciated.
Thanks,
Kishor
What I have tried:
Till now, i read the string as is and parsed to required contents.
For example if the string is "Monotype Corsiva, 15.75pt, style=Bold, Italic" i parsed seperately and created CFont object.
Is there any better way ?
推荐答案
这篇关于如何将cstring转换为cfont *的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!