Re: [Indic-computing-devel] Re: NCST Indix Examined
Status: Alpha
Brought to you by:
jkoshy
From: Keyur S. <key...@ya...> - 2002-02-22 10:13:56
|
Hi, --- Arun Sharma <ar...@sh...> wrote: > For everything > 256, it delegates it to gdk, which > delegates it to > XTextExtents(). XTextExtents is a network efficient > function, in that it > is capable of responding to requests locally (unlike > XQueryTextExtents, which has to consult the X server). > > The way IndiX has implemented it, XTextExtents is mapped > to > XQueryTextExtents - sacrificing network efficiency. In > other words, when you > drag your mouse, gtk will execute the above loop and a X > protocol > request is made for every character to compute its width. ^^^^^^^^^ It should be syllable. In Indic scripts, it is better to select entire syllable while dragging mouse over the character string. Unlike other foreign languages in which a character is the smallest unit of writing system, we consider syllable as the a basic typographical unit of our writing system. It also simplifies interaction with the user. This will also not create problem at the time of selection through mouse as Koshy probed earlier since reordering is done for each syllable and we select entire syllable in the selection operation. The following operations are proposed : (1) Selection should select entire syllable (2) Cursor should move over the syllables (3) Delete key should remove the entire next syllable (4) Backspace should delete a character from the previous syllable (5) Insertion of new character may increase/descrease the number of syllables (6) Deletion of a character may decrease/increase the number of syllables Yes. In (5) and (6), both the cases are possible. I'll give examples when it comes to proper discussion. > > A new protocol request - such as XComputeWidth (Is > XComputeNChars a > better name ?) will batch these XQueryTextExtent requests > into a single > request. Keyur, I didn't understand your comment on why > this > functionality doesn't belong to the X server. Or did I > misread your > statement ? I meant to say that maintaining backbuffer for text and selection of text is not the functionality of server. The client itself does all the job and can also send requests to server to compute width of a character stream. I think my sentence was ambiguous. > Another data point: Using character codes is NOT > unprecedented in > XFree86. I just finished reading the i18n specs. > > http://www.x-docs.org/i18n/Framework.pdf > > and looked at the implementation: > > xc/lib/X11/omDefault.c - _Xutf8DefaultDrawString > > The input is clearly a UTF-8 string. It's calling > _XmbDefaultDrawString > which is calling XDrawString, which is doing a PolyText > request in the X > protocol. In other words, a character code is being sent > over the X protocol. I wonder why this example didn't come into my mind while arguing about use of character codes in XDrawString. This is a perfect example which proves that current implementation of XFree86 doesn't restrict clients to send character codes in PolyText request. Arun, thanks for drawing my attention towards it. > On a related note, can anyone on the list enlighten me on > the difference > between utf8 and mbs (multi byte string) ? I thought > UTF-8 was a mbs too. Yes. UTF-8 is also an mbs. In fact any string encoded in locale dependent encoding can be thought of as mbs while calling XmbDrawString. XmbDrawString is a function to draw string encoded in locale dependent encoding. A locale may have stateful or stateless encoding scheme. XmbDrawString calls various conversion routines to correctly decode the string in the form (e.g., 16-bit Unicode string in a UTF-8 locale using ISO-10646 encoded font) suitable for XDrawString and then finally use XDrawString to send request to server. mbs is always locale dependent while UTF-8 is always locale independent. Under non-UTF-8 locale their functionality is different but under UTF-8 locale their functionality should be exactly same. Regards, Keyur __________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com |