Font problem

Posted on 2002-04-25
Last Modified: 2013-12-02
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("      ");
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 ?

Question by:yoavo
  • 2
LVL 23

Expert Comment

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

May be your charset is SYMBOL_CHARSET

LVL 23

Accepted Solution

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

May be your charset is SYMBOL_CHARSET


Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
font missing in acrobat 3 74
windows 10 how make picture as desktop background 2 62
Shell script to login to remote m/c and execute commands 10 78
mapAB Challlenge 35 143
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
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…

786 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