Re: [Indic-computing-devel] NCST IndiX examined
Status: Alpha
Brought to you by:
jkoshy
From: <jk...@Fr...> - 2002-02-11 11:11:36
|
Dear Keyur, ks> When Xlib converts 8-bit string into 16-bit string, it ks> first send MSB first. This is same as Little-Endian UCS-2. The X11 Protocol definition predates Unicode. This isn't Little-Endian UCS-2, its just a 2-byte encoding of the 8 bit glyph indices. ks> If you are still not happy with my explanation, then put a ks> 'printf' sentence in the function XQueryTextExtents and see ks> the values passed in the request. :) ks> How can client have knowledge about the glyph indices? That is what the encoding field in the long name of X fonts is for. For Latin fonts this will be `-iso8859-1' meaning the font is encoded compatibly with the ISO8859-1 character encoding. There can be other encodings; Big5 (chinese), iso8859-8 (latin+hebrew) or iso8859-5 (latin+arabic). You can have fonts that are not indexed by character codes and fonts that follow different encoding schemes e.g:- hp-roman8. The client has to select the correct glyph indices in the X text drawing calls, appropriately. If the font's glyph encoding matches the character encoding, then an X client can just send over the numeric values of 'characters' unchanged and the correct glyphs will get selected automatically. This is what you are seeing when you put a "printf()" in "XQueryTextExtents()". TrueType fonts do have a 'cmap' that maps from character codes to internal glyph indices. This happens to work in X because the X client is assuming a font encoding (like iso8859-1) when sending over the glyph indices and the fonts 'cmap' is setup to map the same character encoding to its internal layout. Such "remapping" by TrueType fonts is out of the scope of the X protocol. ks> Please read the first sentence in ks> X Protocol Specification, Glossary, pp 37 ks> "This request returns the logical extents of the ks> specified string of characters in the specified font". ^^^^^^^^^^^^^^^^^^^^ Agreed, this is poorly worded. You need to read the formal definitions of FONT, STRING8 and STRING16 to put the definition in context. See also the protocol descriptions for PolyText{8,16} and ImageText{8,16}. ks> Unfortunately, I don't have test suite installed on my ks> system. It is not there in xc/test :( I am also not able to ks> locate it on XFree86 site. Will you please tell me where ks> can I get it from? It is part of the XFree86 repository, available under directory "test/", a sibling of directory "xc/". It can be retrieved in the usual ways (Anon-CVS checkout, CVSup mirroring etc). Anyone changing the X11 library or the X server really should be running the test suite to check for breakages. Do be sure to run the test suite from a remote (unmodified) system as well as locally. Regards, Koshy <jk...@fr...> |