basic bidi support using perl

James Cloos cloos+rxvt-unicode at jhcloos.com
Tue Aug 22 06:41:14 CEST 2006


>>>>> "Moshe" == Moshe Kamensky <samvimes at fastmail.fm> wrote:
>>>>> "Marc"  == Marc Lehmann   <schmorp at schmorp.de> wrote:

Moshe> I added basic bidi support, using the perl interface and the
Moshe> perl FriBidi module:

Marc> Wow, what a wonderful hack! And so small!

Indeed!  Way cool.

Marc> I think (from my limited knowledge) that the only "correct" way
Marc> to implement this is to store text in transmission order and
Marc> only apply bidi when displaying it, which is not trivial.

That is correct.

Marc> I do plan to implement this by relying on pango at one point,
Marc> though, merely storing a flag per line wether it is "complex"
Marc> (== needs a complex layouter like pango) or "simple" (== can
Marc> use urxvts algorithms).

The FriBidi perl module links against libfribi (cf: http://fribidi.org);
you can call it directly from the C++ as well.  (It is C++ friendly.)

Pango uses it for the bidi stuff, too, so it is a good stepping stone
to full shaping capability.

Although, I do wonder how much shaping a terminal requires?  Is there
a way to help out simpler apps while not getting in the way of apps
which already know how to do shaping?

Marc> That way, I could move the complexity into pango (which is
Marc> likely better maintained than I could do it) while maintaining
Marc> normal speed.

Good call.

And kudos again to Moshe.  Cool script!

-JimC
-- 
James Cloos <cloos at jhcloos.com>




More information about the rxvt-unicode mailing list