Re: [Indic-computing-devel] NCST IndiX examined
Status: Alpha
Brought to you by:
jkoshy
From: Keyur S. <key...@ya...> - 2002-02-11 08:04:37
|
Dear Joseph, --- Joseph Koshy <jk...@Fr...> wrote: > > ks> Err! Please carefully see the source code of > xc/lib/X11/QuTextExt.c > I don't see anything specific to Unicode or UCS-2 in this > file. When Xlib converts 8-bit string into 16-bit string, it first send MSB first. This is same as Little-Endian UCS-2. > There is only one [QueryTextExtents] protocol request in > the X11 > protocol. This request is used for both the > `XQueryTextExtents16()' > and `XQueryTextExtents()'. It expects 2 byte glyph > indices. These are not glyph indices. These are character codes which are passed in the request. The X server passes it to the appropriate font library which then maps these character codes to the glyph codes and do the further processing. "The client simply indicates values used to index the glyph array." In this sentence 'values used to index the glyph array' means 'character codes' which are used to index the glyph array using some mapping table (e.g., cmap table in TrueType font) in the font. > > For "linear" (single byte) glyph indices, the X library > makes the MSB > of each 2 byte glyph index to be zero (i.e. linear > encodings are > treated as row 0 of a 2-D glyph matrix). All this is > explained in the > X Protocol specification. [See Page 37, > QueryTextExtents] Please read the first sentence in X Protocol Specification, Glossary, pp 37 "This request returns the logical extents of the specified string of characters in the specified font". ^^^^^^^^^^^^^^^^^^^^ Let me explain this through an example. Client passes a string of characters, e.g., "Hello World", in XQueryTextExtent. Xlib will convert it into 16-bit string before sending it to Xserver in 'QueryTextExtents' request. At this place no conversion from these character codes to glyph codes is done. At the server side, proper font renderer (font library) is chosen (see xc/lib/font). This font library then gets glyph ids and other glyph information (glyph metrics etc.) from this character string using a mapping table stored in the font. Font library then passes this information back to the XServer which then processes the request further and finally either send reply/error/event or fulfill the request (as in case of XDrawString). In the mapping table of the font, character code is not necessarily same as glyph code (glyph id). For example, character 'A' which has character code 65 may be at glyph position 10 and thus having glyph code 10. In the font table, there is a mapping from character code 65 to glyph code 10. If you are still not happy with my explanation, then put a 'printf' sentence in the function XQueryTextExtents and see the values passed in the request. :) > ks> In my view, it is compatible with the X Window System > protocol. > > You seem to have ignored the part of the X protocol > specification > (that I had quoted in my review) that explicitly states > that the X > protocol DOES NOT deal with character codes and that the > clients just > use indices into the glyph array. As I have explained earlier, you have misinterpreted the sentence. How can client have knowledge about the glyph indices? Client always pass character string in Xlib routine. > > If you want to see the effect of your changes on protocol > compliance, > you could: > > (a) run the X protocol test suite. In particular, > Unfortunately, I don't have test suite installed on my system. It is not there in xc/test :( I am also not able to locate it on XFree86 site. Will you please tell me where can I get it from? > You are probably the best placed in our group of > developers to talk > about the technology behind Indic script rendering. I > am looking forward to learning from your experience. Do > you have tutorial or writeup on Indic rendering that you > could share with this group? Sure. Working as a group, we shall definately arrive at some solution. I'll be happy to share my experience with this group. I would also like to comment on various design issues that you explained in one of your earlier mails. There are some documents on Indic rendering (not written by me). I'll send you pointers. I'll also give the document written by us. We also have developed a series of printing tools that can produce high quality PS file using outlines. It uses OpenType font and supports UTF-8, ISCII, and UCS-2 (Little-Endian and Big-Endian) encodings. I am looking forward for your feedback on these tools. I'll also register all our projects on sourgeforge. Regards, Keyur __________________________________________________ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com |