David J. Perry
2017-09-17 19:26:04 UTC
The OpenType spec says that when a layout engine encounters a situation
where mirrored glyphs are required, it should automatically apply the
<rtla> or <rtlm> features (assuming they exist in the font). LibreOffice
and TextEdit / Nisus Writer (latter Mac only) do this. See the "Simple
RLO Test" screen shot. (BTW: I attached the screen shots. Does this
list allow images in the body of a message?)
XeLaTeX does not. It correctly places the characters RTL after inserting
a right to left override (RLO, U+202E), but the shapes are not mirrored.
See the minimal example below and the screen shot taken from the output
PDF. The same font was used to generate both of the screen shots. (If
you wish to try this for yourself, you will need a font that includes
both the Old Italic block of Unicode and the appropriate OT features. I
will share the one Iâm making if anybody is really interested.)
Also, inserting a space character or a command such as \hspace breaks
the effect of the RLO. Iâm not completely surprised by this, given how
TeX operates with runs of text, but I wish it wouldnât.
Xe(La)TeX has always been my go-to software for testing OT features that
other software canât deal with. Iâve been able to get weird things like
localized features for ancient languages to work; no problem in XeTeX,
you declare the script and the language and the features work. So Iâm
disappointed that it doesnât flip the characters. Am I missing something
obvious?
Also, before anyone asks: I am familiar with the bidi package. Itâs
common for scholars to insert short RTL texts, one or a few words, in a
document that is otherwise LTR. In such a situation there is no need for
the advanced facilities that bidi provides, such as getting whole
paragraphs to work RTL and so forth. So I hoped I wouldnât have to use
it in such situations. (I assume it would automatically mirror the
characters; yes?)
MINIMAL EXAMPLE (Note: unless the font you are using to view this has
the Old Italic characters, it will look wrong.)
% !TEX TS-program = xelatex
% !TEX encoding = UTF-8
\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\setmainfont{Times New Roman}
\begin{document}
We are going to test the Old Italic range of Unicode.
\fontspec{Italica Vetus} %use any font that contains the Old Italic
characters and the <rtla> feature.
\medskip
\space{.7in}ðððððð ððððððððððð
+RLO\hspace{.25in}\char"202Eðððððð ððððððððððð
+RLO\hspace{.25in}\char"202Eðððððð ðð\hspace{.25in}ððððððððð
%this breaks the run
\medskip
Now back to left to right text.
\end{document}
where mirrored glyphs are required, it should automatically apply the
<rtla> or <rtlm> features (assuming they exist in the font). LibreOffice
and TextEdit / Nisus Writer (latter Mac only) do this. See the "Simple
RLO Test" screen shot. (BTW: I attached the screen shots. Does this
list allow images in the body of a message?)
XeLaTeX does not. It correctly places the characters RTL after inserting
a right to left override (RLO, U+202E), but the shapes are not mirrored.
See the minimal example below and the screen shot taken from the output
PDF. The same font was used to generate both of the screen shots. (If
you wish to try this for yourself, you will need a font that includes
both the Old Italic block of Unicode and the appropriate OT features. I
will share the one Iâm making if anybody is really interested.)
Also, inserting a space character or a command such as \hspace breaks
the effect of the RLO. Iâm not completely surprised by this, given how
TeX operates with runs of text, but I wish it wouldnât.
Xe(La)TeX has always been my go-to software for testing OT features that
other software canât deal with. Iâve been able to get weird things like
localized features for ancient languages to work; no problem in XeTeX,
you declare the script and the language and the features work. So Iâm
disappointed that it doesnât flip the characters. Am I missing something
obvious?
Also, before anyone asks: I am familiar with the bidi package. Itâs
common for scholars to insert short RTL texts, one or a few words, in a
document that is otherwise LTR. In such a situation there is no need for
the advanced facilities that bidi provides, such as getting whole
paragraphs to work RTL and so forth. So I hoped I wouldnât have to use
it in such situations. (I assume it would automatically mirror the
characters; yes?)
MINIMAL EXAMPLE (Note: unless the font you are using to view this has
the Old Italic characters, it will look wrong.)
% !TEX TS-program = xelatex
% !TEX encoding = UTF-8
\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\setmainfont{Times New Roman}
\begin{document}
We are going to test the Old Italic range of Unicode.
\fontspec{Italica Vetus} %use any font that contains the Old Italic
characters and the <rtla> feature.
\medskip
\space{.7in}ðððððð ððððððððððð
+RLO\hspace{.25in}\char"202Eðððððð ððððððððððð
+RLO\hspace{.25in}\char"202Eðððððð ðð\hspace{.25in}ððððððððð
%this breaks the run
\medskip
Now back to left to right text.
\end{document}