WM中文字体无法显示 [英] WM chinese font can not display
本文介绍了WM中文字体无法显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我今天更改了Windows Mobile AKU 23121,并测试了我的软件.
但是我发现了一个错误.
这是我的代码:
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);
我想要显示"Font字体FONT字体",但它是"FontFONT",
更重的是:如果我不旋转字体,它可以显示正常. :omg:
请帮助我~~~~~
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 ~~~~~
推荐答案
尝试在调用CreateFontIndirect()
:
之前将此属性添加到您的LOGFONT
Try to add this property to yourLOGFONT
before callingCreateFontIndirect()
:
pFont.lfCharSet = GB2312_CHARSET;
这篇关于WM中文字体无法显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文