7 Documents with text that is not in English7.3 Chinese, Japanese, and Korean7.4 Right-to-left writing

7.4 Right-to-left writing

Scripts with right-to-left writing require some extra care. Here is a solution that works for Farsi (Persian) using Xetex (Arabic and Hebrew should be usable with the same approach):

Include the stylesheet right-to-left.isy from the Ipe stylesheet folder. It defines a text style rtl for right-to-left text objects.

In the document properties (that is, in the Document properties dialog, available on the Edit menu), set Latex engine to xetex, and the Latex preamble to

\usepackage[documentdirection=lefttoright]{xepersian}
\usepackage{bidi}
\settextfont{FreeFarsi}
(I needed to install the packages texlive-lang-arabic and fonts-freefarsi on my Linux system to use this.)

It is important to set the option documentdirection=lefttoright for the xepersian package, as the main document needs to be processed left-to-right for Ipe to work correctly. Only individual text objects will be translated using right-to-left mode.

You can now have text objects with Latin script using the normal text style, and text objects with Persian script using the rtl text style.

If you want, you can make rtl the default text style, with the following customization:

prefs.initial_attributes.textstyle = "rtl"