2

The Unicode Bidirectional algorithm mandates that the glyph for the character "left parenthesis" (and many others) be inverted when displaying text in RTL direction.

However I am trying to typeset in ConTeXt a text in hebrew and parentheses appear incorrectly, )like this(. What can I do to invert them in the typesetting engine (I mean, without having to change the characters in the original text)? This question was asked before, but for LaTeX and XeLaTeX. I would need a solution for ConTeXt Mark IV

I attach a minimal working example:

\definefont[hebrewfont][arial at 12 pt]
\starttext
\textdir TRT
\hebrewfont
שלום (אני) כותב\\
\stoptext
ShreevatsaR
  • 45,428
  • 10
  • 117
  • 149
Ralph
  • 765

1 Answers1

5

The proper, high level, commands for setting text direction in ConTeXt are \setupalign and \setupdirections (they are “experimental” though).

\definefont[hebrewfont][dejavusans at 12 pt]
\setupalign[r2l]
\setupdirections[bidi=global]
\starttext
\hebrewfont
שלום (אני) כותב\\
\stoptext

For my personal work I use the context-bidi module (wrote myself, even more experimental).

ShreevatsaR
  • 45,428
  • 10
  • 117
  • 149