|
-
April 3rd, 1999, 10:52 PM
#1
different fonts
How can I print text to an mdi child in a different font? I would love to print text in say times roman with bold, or italics, or underlined.
Any response any one can give me will be greatly appreciated.
-
April 5th, 1999, 10:57 AM
#2
Re: different fonts
In your view's OnDraw function, do the following:
CFont MyFont;
MyFont.CreatePointFont(12, "Arial" ); // for 12pt Arial
pOldFont = pDC->SelectObject(&MyFont);
pDC->TextOut(x, y, "Hello");
pDC->SelectObject(pOldFont);
MyFont.DeleteObject();
CreatePointFont is the easiet way to create a font. If you want italics, bold, etc. check the documentation for CreateFont and CreateFontIndirect under CFont.
Good Luck.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|