Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

Font problem

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
yoavo
Asked:
yoavo
  • 2
1 Solution
 
Roshan DavisCommented:
change LOGFONT's lfCharSet to different types.

May be your charset is SYMBOL_CHARSET


GOOD LUCK
0
 
Roshan DavisCommented:
change LOGFONT's lfCharSet to different types.

May be your charset is SYMBOL_CHARSET


GOOD LUCK
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now