Date: Fri, 31 Dec 2004 12:06:29 +0100 From: DVE - Gabriele Brugnoni Subject: Microwindows and unicode Dear Greg, I would like to implement in my modified version of microwindows some unicode implementation, to let arabic text works. I've seen that the low level GD graphics functions support well UTF8 and UC16 encoding. Some Microwindows API supports UTF8 (GetTextExtentPoint for example) and other does not (DrawText for example, is defined as DrawTextA. It is implemented also as DrawTextW, but not for UTF8). So my idea is to add a MW API that lets user select between ascii or utf8, something like: MwSetTextCoding ( int mode ) where mode may be MWTC_ASCII or MWTC_UTF8. In this way the text function may consider text as ascii or utf8. I'm about to modify my EDIT class, to implement bidi properties, and for this scope i would like to use the fribidi library. Controls should render text in the correct direction, and perform some rendering adjustment (shape/joining for arabic is an example). I think that this should be done in each control code, and not in the low level mw api. To handle input keys, we may implement a function that translate chars and VK codes into UC16 chars, like the Windows notification WM_UNICHAR. It may be: MwSetKeyboardTranslator ( LPFN_KEYBTRANSLATOR fnTranslate ); and typedef BOOL (*LPFN_KEYBTRANSLATOR)(WPARAM *kbdChar); (The wParam sent in WM_CHAR is forced to UC16, and may be converted by controls in UTF8). What you think about ? Do you have any suggestion ? Thank you, and happy new Year! Regard Gabriele -- ____________________________________ DVE Progettazione Elettronica Via Sorrisole 80 - 21100 Varese Tel +39 332 229091 email: info@dveprojects.com