groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Groff] Hebrew for groff?


From: Ted Harding
Subject: RE: [Groff] Hebrew for groff?
Date: Tue, 28 Nov 2000 16:35:58 -0000 (GMT)

Hi,

On 28-Nov-00 Ephraim Yawitz wrote:
> I hope it's OK for me to just send an e-mail to the list like this;
> that's the impression I got from the webpage describing the list.
> What would have to be done in order to make groff produce right-to-left
> output for Hebrew, etc?  I might be able to work on it if I knew at
> least where in the code to start hacking.  Is this something
> reasonable, or outlandish?
> 
> Thank you,
> 
> Efraim Yawitz

This was achieved for UNIX device-independent troff ("ditroff") a good
while ago by Dan Berry, who created the "ffortid" postprocessor to handle
right-to-left languages.

Done in the first place for Hebrew, this was later extended to cope
with Arabic including the "calligraphic" lateral extensions and
overlaps required for classy printing.

I really must try to put together either a collection of Dan's source
code and sample outputs for people to consult, or try myself to get it
to work for groff (which it does not straightforwardly do, since Dan's
code depends rather intimately on the format of ditroff font descriptions
which differ from groff's).

However, the basic trick for Hebrew is simple. When right-to-left text
is encountered, a special code is passed through to the post-processor
(using \X'ps: ... ') announcing the fact. The troff formatting, however,
is still done left-to-right so as to get the line-filling and spacings
correct. Each line therefore comes out of troff as Hebrew left-to-right
(possibly with some non-Hebrew left-to-right). The post-processor then
picks up the sequence of characters that should be right-to-left in each
line, and reverses their order. Some tweaking using the font metrics may
then be required. Similarly, when text reverts to left-to-right, a
corresponding code is passed through to the post-processor and all
subsequent text simply goes straight through unchanged.

Dan Berry also implemented a "triroff" which includes capability to
print up-and-down languages like Chinese and Japanese. This essentially
treats each character as a cell in a table, but saves the user having
to construct the table with his bare hands.

I hope this helps.
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 284 7749
Date: 28-Nov-00                                       Time: 16:35:58
------------------------------ XFMail ------------------------------

reply via email to

[Prev in Thread] Current Thread [Next in Thread]