> -----Original Message----- > From: John E. Davis > Sent: lunedì 12 settembre 2005 16.51 > Subject: Re: Roadmap for 0.99-17 Hi John, jedders > The roadmap to 0.99-18 release will involve at least one more > 0.99-17 release after I add unicode font support to Xjed. [SNIP] As I said in another mail , some time ago I did some changes to xjed to add unicode support. Sadly I can't find those files anymore. But as I got some experience by porting WJed to unicode, yesterday I took some time to rewrite the code from scratch. The resulting patch is attached. you can see a screenshot of xjed showing UTF-8-demo.txt at http://www.paneura.com/~dino/files/xjed-unicode.png. (I did it on Linux FC4, using: xjed -fn MiscFixed -fs 12 UTF-8-demo.txt Note that the font is not antialiased, but it has a lot of extra unicode characters). For the output this version uses XftDrawStringUtf8() instead of XftDrawString8() (a simple rename is enough), and Xutf8DrawImageString() instead of XDrawImageString() (this requires also a fontset). To handle the unicode data, I mixed the solution used for WJed with some code from sldisply.c (in SLang): - JX_smart_puts() was rewritten: now we have a function far smaller than before, and is able to handle both new (SLang 2 style) and old (SLang 1 style) data. - JX_write_smgchars() also was rewritten: again a single function should handle both Slang 1 and and 2. These functions use three macros: SLSMGCHAR_EQUAL, SLSMGCHAR_SET_CHAR and SLSMGCHAR_SET_COLOR, the names are a big hint that these should be in SLang :-) note also that the current patch uses only SLSMGCHAR_EQUAL, but this is because this patch miss some things. There's also one function (decode_smgchar()). These *ARE* Slang version dependent, and the patch has code for both. The SLang 2 version of decode_smgchar() is taken from sldisply.c, function send_attr_str(), and reworked. What's missing: - Refresh (on expose event) does not work. This is mainly because there's no way to write a Slsmg_Char to vterm, the vterm interface still works on strings. Marko Mahnic wrote a version that works on utf8 strings, but as vterm saves the data as SLsmg_Char_Type, this means we need two conversions from and to utf-8!!! - Cursor handling is broken: as above, the cursor drawing relies on vterm, but now it has bad data for unicode text. I had the same problems while working on WJed, and everytime I think about it, I become more convinced that vterm is not needed. We have the same information on SLang buffer and we already can access it by and exported SLang function (SLsmg_read_raw()). Getting rid of vterm saves more that 300 lines of code, a lot of data duplicated in memory, and the burden of keeping SLSMG buffer and vterm buffer aligned (this means also no more hacks like VTerm_Suspend_Update). - Keyboard input in UTF-8 mode (I don't know if this is a problem, I have not looked at it yet). - Detecting UTF-8 enabled mode (by now the patch assumes UTF-8). - How (and maybe if) to handle a UTF-8 enabled xjed without utf8 support from X. - compiling with SLang 1 not tested. - the patch does not remove the old code (to keep it small). John, I you want I can try to put a fully functional version this weekend. Also comments and suggestions from everybody will surely be useful. Thanks, Dino
Attachment:
xterm.diff
Description: Binary data