Content-type: text/html Manpage of Biditext

Biditext

Section: Haifa Linux Club (1)
Updated: January 2002
Index Return to Main Contents
 

NAME

biditext - enable showing bidirectional texts in X programs  

SYNOPSIS

biditext [--auto-refresh] program [ arguments ]  

DESCRIPTION

--auto-refresh
Load support for automatic refreshing using refreshd (see below)

biditext.so is a shared library that replaces the XDrawString(3) , XDrawImageString(3) , XDrawString16(3) and XDrawImageString16(3) functions from the libX11 library, with ones that support bidirectional printing. It will perform reversing only on fonts with Hebrew encodings (iso8859-8, microsoft-cp1255 and iso10646-1). biditext is a convenience script which sets the LD_PRELOAD environment variable to include biditext.so and then runs the original program.

The behaviour of those functions is changed 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 effect immediately, so it can be used when using Netscape to browse 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 that 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(1) 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 be updated immediately. The change will take effect only once the text will be redrawn (e.g.: by refreshing the whole window, or if refreshd (see below) is running)

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.  

REFRESHD

Refreshd is a program that keeps track of windows that are created by biditex-ed programs and refreshes them whenever r2llib enables, disables, or changes base directionality. It is composed of of a daemon (that keeps track of windows lists and sends refresh requests to windows when necessary) and of hooks in the application themselves that report to the daemon of windows creation.

The hooks in the clients is a shared object ( refreshd_hook.so ) that is loaded in the same way as biditext.so .  

FILES

$HOME/.rev
This file's contents determine biditext's exact operation. It should not be handled directly, use the r2l(1) utility to manipulate it.
 

ENVIRONMENT

BIDITEXT_FILENAME
The file which keeps the biditext state information. See above. Although the r2llib does not require that it is set, the biditext script sets the value of BIDITEXT_FILENAME to the default value ($HOME/.rev) if this variable was not set.

BIDITEXT_OPTIONS

A comma-separated list of options, that can be used to modify biditext's behaviour. If two contradicting values appear, the last value is the one that counts.

PROFILE
Enable printing of profiling information to stderr.
NO_CHECK_CHARSET
CHECK_CHARSET (default)
Disable checking of the string's character set to decide if it should be reversed.
TRACE_ANY
TRACE_CHARSET
TRACE_LOG2VIS
NO_TRACE (default)
For debugging: trace the printed string in various levels. TRACE_LOG2VIS will only before passing the string through fribidi (if reversing is enabled), TRACE_CHARSET will also print the string after it has passed the charset test successfully. TRACE_ANY will also print the string when first entered to a hijacked function.
LD_PRELOAD
biditext.so (and refreshd_hook.so, if --auto-refresh was given) are loaded to all the programs by setting LD_PROLOAD. This causes the libc loader to load those library for all the programs.

 

REQUIRES

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

r2llib Biditext requires r2llib (version >= 0.32) which should have been already supplied with it. If not, it is available from http://linuxclub.il.eu.org/R2L/  

BUGS

biditext is not a complete replacement for complete support of bidirectional Hebrew in programs. This approach has some obvious limitations, that were mentioned above.

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 reverse your text (because it is not exactly Hebrew). Apply the Turkish patch to netscape. Alternatively, set NO_CHECK_CHARSET in BIDITEXT_OPTIONS
 .

If the program that you want to run under biditext uses some component archteture (KDE's KParts, or GNOME's bonobo) then there may be parts of that application that are presented by other processes that were not even spwned by your original process. Thus those parts may not run with biditext support. See http://plasma-gate.weizmann.ac.il/Linux/maillists/01/12/msg00504.html

Regarding the changes of 0.9 and the Elmar fonts: See http://plasma-gate.weizmann.ac.il/Linux/maillists/01/07/msg00242.html

There is another function similar to XDrawString that is used for anti-aliased text (XftDrawString). This function is currently not handled by biditext.  

AUTHORS

Matan Ziv-Av (matan@svgalib.org)

Ilya Konstantinov (biditext@future.galanet.net)

mulix (mulix@actcom.co.il)

Tzafrir Cohen (tzafrir@technion.ac.il)  

SEE ALSO

r2l(1) , refreshd(1) , r2lterminal(1) , r2ldockapp(1) , r2lgnomeapplet(1) (when they'll be written)


 

Index

NAME
SYNOPSIS
DESCRIPTION
REFRESHD
FILES
ENVIRONMENT
REQUIRES
BUGS
AUTHORS
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 20:32:22 GMT, March 24, 2002