biditext.so is a shared library that replaces the XDrawString,
xXDrawImageString and XDrawString16 functions from the libX11 library,
with ones that supports bidirectional printing. It will perform reversing
only on fonts with Hebrew encodings (iso8859-8, microsoft-cp1255 and
iso10646-1).

This library requires Dov Grobgeld's fribidi library (version >=0.1.6), which 
is available from http://fribidi.sourceforge.net, that requires glib.

This library requires Haifux's r2llib library (version >= 0.32) which
might have been already supplied with it. If not, it is available from
http://linuxclub.il.eu.org/R2L/ or
http://www.technion.ac.il/~tzafrir/R2L/

[ Note: chances are that you get biditext as part of the package r2l that also
includes r2llib ]

To compile, run make. 
To install run 'make install' (as root).

To use, make sure the library is loaded by the dynamic loader
(ld-linux.so), before libX11.so. This is usually done by setting the
LD_PRELOAD environment variable. You can use the included script biditext.
to run programs:
  
  biditext program [argguments ...]

For example:

  biditext netscape 


XDrawString changes the direction of the text only when a file .rev in
your HOME directory exists, so when it does not exist, it behaves, exactly
like the normal function from libX11.so. Creating or removing this file
takes affect immediately, so it can be used when using Netscape to browse
Hebrew sites, and moving between pages that use Visual / Logical Hebrew. 

If you want to use another name (instead of $HOME/.rev) set the environment
variable BIDITEXT_FILENAME to that file name before running biditext. e.g.
(works with bash):
  
  BIDITEXT_FILENAME=$HOME/.rev-ns biditext netscape


See http://linuxclub.il.eu.org/R2L/ for some programs thet provide simple 
graphical interfaces for this feature. 

This version also allows you to set the base directionality. See:
http://www.mail-archive.com/lin-club%40vipe.technion.ac.il/msg00323.html for
the exact details, and
http://www.mail-archive.com/lin-club%40vipe.technion.ac.il/msg00327.html for
some demostrations.

r2llib also provides a simple 'r2l' command line program to query and
set the r2l state and biditext base state. 

Note that the approach used by biditext has some inherent limitations. The
program is not aware of the logical->visual conversion and thus:
* May draw parts of the line in seperate XDrawString calls (e.g: when editing
  a text, or when selecting it)
* When you decide to create (or delete) the .rev file, the program's window
  will not update immedietly. The change will take effect only once the text
  will be redrawn (e.g.: by refreshing the whole window)

(The refreshd package of the r2l project is meant to answer the second
problem. It's available from the afore mentioned locations)

It seems that the standard text box of qt2 programs does not suffer from the
first limitation, and editing text with QT2 programs (like kedit and licq)
works well, if you have got past the fonts problem.


Known Bugs:
* With some versions of fribidi, gtk programs will vrash immedietly when
  used with biditext. This is because fribidi was compiled with a version of
  glib that is incompatible with the version with which gtk was compiled.
  In such a case try either rebuilding fribidi or upgrading it (fribidi >=
  0.10.1 is recommended)
* May have problems with programs that do some manipulations with the loader,
  e.g.: licq. 
* 0.9 added recognition of the character set, and reverses only Hebrew
  strings. Thus if you use netscape 4 with web fonts, it won't revesse your
  text (because it is not exactly hebrew).
  Apply the turkish patch to netscape, or run biditext with NO_CHECK_CHARSET
  in BIDITEXT_OPTIONS (see the man page).
* Regarding the changes of 0.9 and the Elmar fonts: See
  http://plasma-gate.weizmann.ac.il/Linux/maillists/01/07/msg00242.html
* Some programs (most notably: latest gtk programs) draw their strings
  word-by-word rather than line-by-line. The result is that each word is
  reversed separately, and thus the text is not properly readable.
* There is another function of similar functionality to XDrawString that is
  used for anti-aliased text (XftDrawString). This function is currently not
  handled by biditext.

Author:
Matan Ziv-Av (matan@svgalib.org)
Ily Konstantinov (biditext@future.galanet.net)
mulix (mulix@actcom.co.il)
Tzafrir Cohen (tzafrir@technion.ac.il)

Copyright:
This program is free, but read the header of Text.so if you care about
licensing.
