Solved

Font problem

Posted on 2002-04-25
2
241 Views
Last Modified: 2013-12-02
Hi,
I have created a new font (called "myfont"), and I am trying to display it in an owner-draw button (I can see my font properly in the "Unicode character map").
I try to display this font in my button:
void CMyButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
     CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
     CFont aFont;
     LOGFONT lf;
     memset(&lf, 0, sizeof(LOGFONT));
     _tcscpy(lf.lfFaceName, _T("MyFont"));
     lf.lfHeight = 12;
     BOOL aRes = aFont.CreateFontIndirect(&lf);
     CFont* pOldFont = pDC->SelectObject(&aFont);
     CString aStr = _T("      ");
     aStr.SetAt(0,0xe002);
     aStr.SetAt(1,0xe008);
     aStr.SetAt(2,0xe009);
     pDC->TextOut(20,20,aStr);
     pDC->SelectObject(pOldFont);
}
My problem is that I see 3 squares instead of the fonts characters.
BTW, In the "unicode character map" I see the characters correctly.

Can anyone help ?
Yoav.


0
Comment
Question by:yoavo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 6968135
change LOGFONT's lfCharSet to different types.

May be your charset is SYMBOL_CHARSET


GOOD LUCK
0
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 100 total points
ID: 6968164
change LOGFONT's lfCharSet to different types.

May be your charset is SYMBOL_CHARSET


GOOD LUCK
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question