Click here to Skip to main content
15,916,835 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi All,

I changed windows mobile AKU 23121 today and tested my software.
But I found a bug.
this my code :
case WM_PAINT:
           {
           hdc = BeginPaint(hWnd, &ps);

                HFONT hFontNew, hFontOld;
                LOGFONT pFont;
                TCHAR szText[100];
                RECT rc;
                memset(&pFont, 0, sizeof(LOGFONT));
                GetObject(GetStockObject(SYSTEM_FONT),sizeof(LOGFONT),&pFont);
                pFont.lfHeight = 21;
                pFont.lfWeight = FW_HEAVY;
                pFont.lfEscapement = 2700;
                pFont.lfOrientation = 2700;
                _tcscpy(pFont.lfFaceName, L"Tahoma");
                hFontNew = CreateFontIndirect(&pFont);


                hSetRect(&rc,105, 120, 150, 320);
                SetBkMode(hdc, TRANSPARENT);
                SetBkColor(hdc,RGB(0, 255,255));
                SetTextColor(hdc,RGB(0, 0, 0 ));
                SetTextAlign(hdc, TA_CENTER | TA_BOTTOM);
                Rectangle(hdc, rc.left, rc.top, rc.right, rc.bottom);
                int ret =  ExtTextOut(hdc, rc.left, (rc.top+rc.bottom)/2, ETO_CLIPPED, &rc, TEXT("Font 字体FONT字体"),
                 wcslen(TEXT("Font 字体FONT字体")), NULL);FontOld = (HFONT) SelectObject(hdc, hFontNew);


I want Display "Font 字体FONT字体", but it is "FontFONT" ,

the more ghost is : If I don't Rotate the font , it can display normal. :omg:

please help me ~~~~~
Posted
Updated 22-Oct-10 0:51am
v2
Comments
Dalek Dave 22-Oct-10 6:51am    
Minor Edit for Grammar.

1 solution

Try to add this property to your LOGFONT before calling CreateFontIndirect():

C++
pFont.lfCharSet = GB2312_CHARSET;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900