3,119
社区成员
发帖
与我相关
我的任务
分享
// set up absolute font-spec and text box for 200 twip Roman font
TFontSpec fontSpec(_L("Times New Roman"),200);
// find the nearest font to the specified one
CFont* screenFont;
deviceMap->GetNearestFontInTwips(screenFont,fontSpec);
// use it for this graphics context
gc.UseFont(screenFont);
gc.DrawText(_L("some example text"),TPoint(20,20));
// discard and release font
gc.DiscardFont();
deviceMap->ReleaseFont(screenFont);