[XeTeX] Add Tibe-tan typesetting ability

Jonathan Kew jonathan_kew at sil.org
Fri Jan 4 19:37:05 CET 2008


On 4 Jan 2008, at 5:24 pm, Lobsang Sonam wrote:

> Hi, dear friends,
>
> 	First a delayed greeting for the new year of 2008!

Thank you - and may it be a good year for you as well.

>
> 	I'd finished the first version of my preprocess to feed its output  
> to XeTeX/XeLaTeX to typesetting Tibe-tan scripts a few days before,  
> which use discretionary to get certain punctuation changed when  
> appear near the head of a line. Thanks Jonathan for help.
>
> 	Now I want to have the \discretionary command to allow glue in its  
> pre-, post-, etc, parameters. I've read the XeTeX document  
> generated from .WEB file. I think just by modifying the following  
> modules: <Display discretionay p>, <Compute the discretionary break  
> width values>, <Subtract the width of node v from break width>,  
> <Try to break after a discretionary fragment, then ...>, and the  
> <Transplant the post-break list>, <Transplant the pre-break list>  
> and have them to allow glue node, I can expand the TeX part of  
> \discretionary to allow glues. But I can't figure out if it  
> interferes with XeTeX implementation.

Something like this might work, though the result will not be  
entirely perfect, at least in theory -- I'm pretty sure that the line- 
break routine assumes that the discretionary lists each have a fixed  
width, and won't take account of any stretch or shrink in the glue  
you put there. (Which means you might as well use kerns, which are  
already allowed.)

Provided the stretch/shrink of your discretionary glue isn't  
dramatically different from other glues in the line, though, you  
might find that the "errors" in line break calculations don't really  
matter in practice, and once the breaks are chosen, whichever glue  
ends up in the final line would probably get re-set along with the  
rest of the glue. So although it's not strictly correct, the result  
might be good enough for practical purposes.

If you try implementing this, I'll certainly be interested to hear  
how well it works!

> And if I want \discretionary support UTF16 chars directly instead  
> of \char"FE3D like stuff, is there anything else I should do?

I think you should be able to use Unicode characters directly in  
\discretionary, just like anywhere else; if not, it's a bug. (A  
simple test seems to work fine here.)

JK



More information about the XeTeX mailing list