It still seems to me mistakes can be made...
Take an example text = (a b c d e) [char codes]
But after reordering = (f-a, f-b, f-c, f-e, f-d) [glyph codes]
Then if ComputeWidth returns 4, wouldnt the client improperly assume char
codes (a, b, c, d) were selected, and not the correct (a, b, c, f)?
If this is indeed a prb, It seems one way to handle this would be to use an
algorithm like Keyurs on the client to make sure only full syllables are
highlighted...
While we discuss this lets not also forget our task of documenting the
current state of affairs wrt indic computing... Since I dont think there
is a clear answer to this X question, one thing positive that could come
out of this is to document the various approaches we have considered so far
for adding indic support to X, and to document the design methodology,
pros, cons, caveats, compatibility, etc... Any volunteers?
I for my part will be trying to find time to document the Mithi and CDAC
Indian lang toolkits, listing features, bugs, pros, cons, etc... so that
we can get an idea of what all more will be required from our end to have a
truly robust indic language working environment...
--Tapan
> > > The proposed new algorithm:
> > >
> > > FindPosition(textpos, startx, pixel_width)
> > > // Make a single request to the X Server - this doesn't exist in
> > > // the X protocol yet
> > > nchars = XComputeWidth(textbuf[textpos:end-of-line], startx,
pixel_width,
> > > // other args font etc)
> > >
> > > // everything starting from textpos to textpos + nchars is "selected"
> > >
> >
> > Is textbuf supposed to be modified and returned by XComputeWidth?
>
> No. Textbuf contains character codes. The reordering happens on glyph
> codes. The X server could do the complex mapping from character ->
> glyph including reordering etc, then compute the width and return the
result.
> The client is completely ignorant about the glyph codes.
>
> XComputeWidth, XPolyText' (a brand new request, which uses character
> codes) and friends could potentially be in an X extension for a server
side
> implementation.
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
|