nanogui: When using Unicode on DrawTextW() prints only one character.


Previous by date: 10 Jul 2001 02:25:13 -0000 about Fl_ValueInput, hongouyang
Next by date: 10 Jul 2001 02:25:13 -0000 nanox not working for framebuffer, ritubhalla
Previous in thread:
Next in thread:

Subject: When using Unicode on DrawTextW() prints only one character.
From: ####@####.####
Date: 10 Jul 2001 02:25:13 -0000
Message-Id: <3B4D0BC1.6000405@neomuse.com>

I've tried to use unicode on DrawTextW().
see how I did:


// static test[] = "Hello!";
static WCHAR test[] = { (WCHAR)'H', (WCHAR)'e', (WCHAR)'l', (WCHAR)'l',
(WCHAR)'o', (WCHAR)'!', 0x0000 };

switch(iMessage) {
case WM_CREATE:
GetClientRect(hWnd, &rt);
return 0;
case WM_PAINT:
hdc=BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &rt);
oldfont = SelectObject(hdc, CreateFont(30,0,0,0,0,0,0,0,0,0,0,0,
FF_SWISS | VARIABLE_PITCH,
"verdana.ttf"));
//DrawText(hdc, test, -1, &rt, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
DrawTextW(hdc, test, -1, &rt, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
DeleteObject(SelectObject(hdc, oldfont));

When using DrawText() it works excellent!
but when I tried to use it in 16bit unicode form, It doesn't work.

Best regards,

Sang-Baek Lee


Previous by date: 10 Jul 2001 02:25:13 -0000 about Fl_ValueInput, hongouyang
Next by date: 10 Jul 2001 02:25:13 -0000 nanox not working for framebuffer, ritubhalla
Previous in thread:
Next in thread:


Powered by ezmlm-browse 0.20.