[XeTeX] Images in LTR text

Will Robertson will at guerilla.net.au
Tue Nov 8 02:29:04 CET 2005


On 08/11/2005, at 7am, musa furber wrote:

> For LaTeX, I suppose would I do is write my own wrappers for  
> \beginL and \beginR that include setting my direction flag.

This is exactly what you should do to logically denote the text that  
you are writing is arabic. This should get you started:
   \newif\ifR
   \newenvironment{arabic}{\beginR\Rtrue}{\Rfalse\endR}

> The immediate use that comes to mind is getting rid of \mfsaaws{}  
> and \mfsaawsa{} which insert the ligature for prayers up the  
> Prophet in English and Arabic text, respectively. I was thinking of  
> inserting the actual glyph, declaring the glyph and active char,  
> and then in that char's macro I could check whether I am in a RTL  
> context (in which case I make sure I am using a font that includes  
> the character) or LTR (in which case I insert a picture of the  
> glyph so I don't mess up the line spacing).
>
> Those last two words give the major rationale for not simply  
> switching fonts in both contexts. I am trying to avoid Arabic  
> within English as much as possible because I always end up with  
> nasty gaps between lines.
>
> Maybe it's just a LaTeX problem and it's time to switch away.

You active char idea sounds like a good one. Using \ifR as sketched  
above should be able to solve this quite nicely.

If you're getting too much space between lines, it is likely that you  
need to adjust values of \lineskiplimit. It seems like a very bad  
idea to insert an *image* of the glyph you want. Look through the  
archives for discussions of using \lineskiplimit; no-one has  
implemented a higher-level approach to this problem yet.

Good luck,

Will



More information about the XeTeX mailing list