Valhalla Legends Archive

Programming => Advanced Programming => Topic started by: Skywing on October 08, 2003, 08:20 PM

Title: "Low-level" Win32 Unicode text output - DrawTextW?
Post by: Skywing on October 08, 2003, 08:20 PM
I've tracked down a problem in displaying some Unicode characters in my MSN messenger program to DrawTextW.

Specifically, if I pass, say, an Arabic or a Japanese character to DrawTextW, it outputs a box.

A Rich Edit control has no trouble correctly displaying these.  What am I supposed to be using if DrawTextW isn't working right, or is there some special thing I need to do to make it work properly?  In both cases, I used the "MS Shell Dlg" font.

If necessary, I can post portions of the code.
Title: Re:"Low-level" Win32 Unicode text output - DrawTextW?
Post by: TheMinistered on October 08, 2003, 09:56 PM
Did you try using DrawTextEx?
Title: Re:"Low-level" Win32 Unicode text output - DrawTextW?
Post by: Skywing on October 08, 2003, 10:58 PM
Quote from: TheMinistered on October 08, 2003, 09:56 PM
Did you try using DrawTextEx?
No.  Unless I'm mistaken, the extra formatting options (tab length, margins) that DrawTextEx provides should not matter here.
Title: Re:"Low-level" Win32 Unicode text output - DrawTextW?
Post by: drivehappy on October 08, 2003, 11:41 PM
"Windows 2000/XP: There is a new interface font called MS Shell Dlg 2. This maps to Tahoma, which is the default font used throughout the system. For an application that runs only on these systems, you can specify DS_SHELLFONT with MS Shell Dlg 2 to map to Tahoma. "
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_4qcn.asp

Maybe try the font-face "MS Shell Dlg 2"?
Title: Re:"Low-level" Win32 Unicode text output - DrawTextW?
Post by: Skywing on October 08, 2003, 11:56 PM
Quote from: drivehappy on October 08, 2003, 11:41 PM
"Windows 2000/XP: There is a new interface font called MS Shell Dlg 2. This maps to Tahoma, which is the default font used throughout the system. For an application that runs only on these systems, you can specify DS_SHELLFONT with MS Shell Dlg 2 to map to Tahoma. "
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_4qcn.asp

Maybe try the font-face "MS Shell Dlg 2"?
I'll give it a try, but a) the program should run on Windows NT4 (and Windows 98), and b) "MS Shell Dlg" works with RichEdit.