[luatex] Fribidi for LuaTeX

luigi scarso luigi.scarso at gmail.com
Tue Jul 12 16:21:29 CEST 2011

On Tue, Jul 12, 2011 at 3:51 PM, Taco Hoekwater <taco at elvenkind.com> wrote:
> Hi,
> Now that the Unicode BiDi algorithm implementation discussion
> seems to restart, it is a good time to ask the people involved
> to solve the non-trivial problem of adjusting the algorithm
> to cater for the inclusion of
> * out-of-line node objects (\setbox, \box, \copy),
> * out-of-line tokens (like alignment templates and macro expansions),
> * vertical typesetting,
> * TeX grouping levels,
> * Interfering nodes (math, \special, \rule etc)
> Thanks in advance,
> Taco

Build a lua binding for fribidi looks simple:: this is a simple
fribidi.i for swig 2.0.2

%module fribidi
#include "fribidi.h"

%include "fribidi/fribidi-common.h";
%include "fribidi/fribidi-unicode.h";
%include "fribidi/fribidi-types.h";
%include "fribidi/fribidi-flags.h";
%include "fribidi/fribidi-bidi-types.h";
%include "fribidi/fribidi-bidi.h";
%include "fribidi/fribidi-joining-types.h";
%include "fribidi/fribidi-joining.h";
%include "fribidi/fribidi-mirroring.h";
%include "fribidi/fribidi-arabic.h";
%include "fribidi/fribidi-shape.h";
%include "fribidi/fribidi-char-sets.h";
%include "fribidi/fribidi-deprecated.h";
%include "fribidi/fribidi-begindecls.h";
%include "fribidi/fribidi-enddecls.h";

The build script assumes Linux 32 bit,  swig 2.0.2, lua 5.1.4  and
/opt/swig-2.0.2 as working dir

rm -vf fribidi_wrap.c
/opt/swig-2.0.2/bin/swig   -lua fribidi.i
gcc -I. -c fribidi_wrap.c -I/opt/swig-2.0.2/include
-I/opt/swig-2.0.2/include/fribidi -o fribidi_wrap.o
rm -vf fribidi.so
gcc -Wall -shared -I. -I/opt/swig-2.0.2/include -L.
-L/opt/swig-2.0.2/lib fribidi_wrap.o -lm -lfribidi -o fribidi.so
strip --strip-unneeded fribidi.so
export LD_LIBRARY_PATH=/opt/swig-2.0.2/lib:$LD_LIBRARY_PATH
lua -e 'require("fribidi")'

In this way maybe one can experiment with the algorithm  without
modify the luatex source .


More information about the luatex mailing list