# [Dev-luatex] Modifying the LuaTeX Engine

Taco Hoekwater taco at elvenkind.com
Sun Dec 28 10:04:54 CET 2008

Hi,

وفا خلیقی، Vafa Khalighi wrote:
>   I have written a small doc explaining some of the main primitives. You
> can find it at http://parsilatex.org/parsitex/primitives.pdf

I've read that document and browsed through tex.ch a bit, and here
are my thoughts so far:

On direction changes
--------------------

If I understand the document correctly, it appears that the automatic
switch works in one of two ways:

A you use a special 8-bit font with the upper half persian and the
lower half latin. This case confines the input to an 8-bit encoding
table, something like Microsoft page 1256.

B or you can use two fonts; a full 8-bit arabic and an 8-bit latin
or symbolic font, and then your font switch triggers the direction
change.

And you can always go back to explicit \begin[LR] \end[LR] commands,
whenever you so desire. I hope I got that right.

Method A can easily be implemented using lua input filtering in such
a way that it is transparent to the luatex user (it should use Unicode
characters and a Unicode-enabled font, of course). Doing that would
not be hard at all and does not require engine changes.

Method B is absolutely unsuitable for luatex because it assumes
that there is only duality in scripts, instead of multiplicity.
For the same reason, a number of the new primitives is unsuited
for luatex (\semichar, \semispaceskip, \everysemi<>, etc.).

On localization
---------------

It is interesting that TeX-e-Parsi can read primitives and keywords
in Persian, and report errors in Persian as well. In Luatex, it is
possible to \let any utf-8 sequence to a primitive, but the
localization of keywords and error messages is something that we
definately can/should look into.

Other stuff
-----------

I can deduce that there are some accent extensions in TeX-e-Parsi,
can you explain a bit about how that works?

Reading the rest of the document, I am a bit curious what \lcode is.
It seems related to wordstring detection?

As far as I can see, the other typesetting-related primitives are
already provided by luatex via Aleph via Omega, and usually in a more
generic fashion.

For example, TeX-e-Parsi has

\rightvbox \leftvbox % write

Luatex has

\boxdir <DIR>        % write

If you feel something is currently missing from luatex in this regard
than you have to be explicit about that, I may well have overlooked
something.

Best wishes,
Taco