[XeTeX] Issue with Arabic Typography

Jonathan Kew jonathan at jfkew.plus.com
Tue Feb 24 13:44:19 CET 2009


On 24 Feb 2009, at 12:19, وفا خلیقی wrote:

> Sorry for repeating the same question again, but since I did not get  
> any response, I will repeat it gain. The answer does not need to be  
> detailed, it can be either "yes, you can do this in xetex" or "no,  
> you can not do it in xetex".

The answer is not that simple. You can do something with xetex macros,  
for example using the inter-char token mechanism to put stretchable  
rules at the joins. But really good Arabic or Persian typography would  
use something more sophisticated than that. It's not really correct to  
provide equal stretchability at all joins; some positions should be  
considered "preferable" to others. But it's pretty hard to implement  
all that at the TeX macro level.

A complete solution would involve support for the OpenType  
justification table, although not all fonts provide this; it would  
apply to more than just Arabic script; and I expect it would involve  
enhancements to TeX's paragraphing routines as well as the hpack()  
function.

There's a partial solution within xetex currently, but only when using  
AAT fonts on the Mac platform; here, it will attempt to apply the AAT  
justification table across each complete line of text. This can work  
pretty well for running text, but is not always so successful in  
complex material where there are frequent style changes, tabulation,  
etc. One trouble is that at the time when TeX actually "packages up" a  
horizontal list, it doesn't know whether this hlist is in fact a  
complete line or a fragment of something larger (such as a table cell,  
a part of a formula, or many other things).

As a simple example, I'm attaching a file that can be loaded in a  
Persian xetex job to provide some simple "stretching".... obviously  
you can make adjustments to the characters involved and the glue  
metrics used, to alter its behavior. This is really just a starting  
point, but might be useful for some purposes.

JK


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PersianKashida.tex
Type: application/octet-stream
Size: 1461 bytes
Desc: not available
Url : http://tug.org/pipermail/xetex/attachments/20090224/c2b90c8e/attachment.obj 
-------------- next part --------------




More information about the XeTeX mailing list