Download Arabic formatting with ditroff/ffortid

Transcript
30
J. SROUJI AND D.M. BERRY
−g[ligature-on-argument] causes atrn to issue
.lg 0
at the beginning of the output for each translation region in order to turn off Latin ligaturing (e.g., ffi → ffi) and
.lg x
at the end of each such region to turn Latin ligaturing back on. If the optional
ligature-on-argument is present, it is used as x ; otherwise x is 1. In addition, if
present, the optional argument −h[hyphenation-on-argument] causes atrn to
issue
.hy 0
to turn on English hyphenation at the beginning of any translated output and
.hy x
to turn English hyphenation back on at the end of any translated output. If the optional
hyphenation-on-argument is present, it is used as x ; otherwise x is 1.
8.2
The Extended ffortid
When ffortid is placed in the pipe between ditroff and a device driver, the result is a
bidirectional version of ditroff in which all text in fonts designated as right-to-left is
printed from right to left. By use of two macros .PR and .PL, the document direction
can be specified as predominantly right-to-left or predominantly left-to-right. The effect
of these is to define on which side of the page is a line considered to begin, and thus,
from where indentation and other line-dependent transformations take place. All other
ditroff commands continue to work, relative to the newly defined line beginning.
ffortid accepts input from ditroff and reorders the contents of each line so that all the
text on the line is printed in its correct direction. Its output is identical in form to that of
ditroff so that any ditroff postprocessor can receive the ffortid output and be none the
wiser about the true source of its input. See Figure 14 for a flow schematic.
It is important to remember that the job of dividing the text into lines and pages is
done by ditroff and therefore, ffortid does not have to know at all about ditroff’s preprocessors. The reader should recall the basic algorithm used by ffortid which is described in
Section 6.
The original ditroff/ffortid is not powerful enough to handle Arabic, Persian, and
Urdu text for two main reason.
1. It does not take care of changing the form of letters based on their positions within
their words.
2. It is not capable of stretching letters to justify the lines to the end, on the right.
The first problem is solved by the atrn preprocessor even before ditroff sees the