[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [emacs-bidi] using fribidi and Pango

From: Tomas Frydrych
Subject: Re: [emacs-bidi] using fribidi and Pango
Date: Fri, 02 Dec 2005 11:24:23 +0000
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Well, you may wish to look at the code I wrote for Emacs:

I do indeed; could you please point me to the relevant file(s) in the

modulo any remaining bugs, it gives satisfactory results and
implements the full UAX#9 algorithm.  It is true that the Unicode
algorithm's description is heavily biased in favor of batch
reordering, but that doesn't mean it couldn't be serialized.  The
fact is that I succeeded doing that.

If that is the case, it would be shame if your work was simply confined
to emacs -- there are many other apps that could benefit from that, and
I think the fribidi maintainer would be interested in incorporating that
into fribidi.

Emacs has so many display-related features that walking all the
characters in the portion of the buffer that is shown on the screen
makes redisplay unbearably slow.  That is why the display code has
many special cases that optimize it in most practical situations (the
simplest ones being cursor movement and insert/delete a single
character).  Any code that needs to traverse large portions of the
buffer to create a cache of some kind will slow down these simple
cases too much.

There is undoubtedly overhead for bidi, but you do not have to walk all
the characters all the time, and the cache does not have to be there for
the entire buffer (I have got very satisfactory results with caching
single line at a time), and more importantly, the cache does not have to
be fully refreshed on every operation on the buffer, as many (perhaps
most) of the normal use cases can be shortcircuted.

It really boils down to how much i18n matters, but you will not get
 decent support for 'exotic' languages unless you do use something
like Pango.

I don't know what is your value of ``exotic'', but Emacs supports
many languages for several years now, since Emacs 20.1.

In which ever way you will achieve that, you will have to do something
like Pango does. It is relatively easy to do until you hit languages
that require shaping; even then it might seem easier to reinvent the
wheel until you come to languages for which contextual glyphs do not
have separated Unicode code points, then it gets bit more interesting
(and you will probably wish you did not set down that road in the first

Whatever you do, if you do not use external script processor you will be
creating one internally and in the process caching significant amounts
of Unicode character properties somewhere in your code. Pango will not
provide out of the box answer for you, I am fully aware of that, but
there might be quite a lot of value to the community in helping to
improve Pango, rather than reinventing the whole thing for emacs alone.


___________________________________________________________ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]