Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In the following example

\definefont[Shehkl][name:Scheherazade*arabic at 15pt] % or file:amiri-regular.ttf*... file:alq.ttf

\definestartstop[Arab][commands=\setups{Arabic}]
\def\Arab{\doArab}
\def\Arab[#1]{
\startArab 
\noindentation
            \setupalign[r2l]\Shehkl#1
\stopArab
}

\starttext

--------------------------------------------------------------------------------------------- (Fitra -\Arab[فطرة])

\stoptext

the last bracket in (Fitra -\Arab[فطرة]) is set into the next line - a mistake of course. One way to avoid that (caused by not correctly handling arabic?) would be to put it all into something like \neverbrakethis[] - which I know from LaTeX, what is the equivalent here - or are there better solutions for this?

share|improve this question
add comment

1 Answer

I don't know much about arabic typesetting, but your ConTeXt source does not appear to be right. Why not use the following, which is simpler and much more direct:

\usemodule[simplefonts]

\definesimplefont[arabicfont][Scheherazade][size=15pt, features=arabic]

\startsetups arabic
  \righttoleft
  \language[ar]
\stopsetups

\definestartstop
  [arabic]
  [commands=\setups{arabic}, style=\arabicfont]


\starttext

English text \arabic{arabic text} english text

\startarabic
  .... arabic paragraph
\stoparabic

\stoptext

Notes:

  1. Ideally, in ConTeXt you want to switch to a complete typescript rather than just switch the main font. With typescripts, font variants such as bold, italic, sans bold, work correctly. I don't know if those variants make sense for Arabic.

  2. I am using the simplefonts module simply because I find it more convenient compared to the low level font commands.

share|improve this answer
    
Your code does not work, try some arabic word (f.e. mine of the above example). But with hbox it now works. –  Mustafa Nov 9 '12 at 6:50
    
Which version of context are you using (output of context --version)? I tested with the input in your example, and do not get any line break between the arabic text and close parenthesis. You do not need a \hbox. –  Aditya Nov 9 '12 at 8:19
    
Yes, but check the arabic output, the letters are not connected anymore, like it should be. I am using 2012.05.30 11:26 –  Mustafa Nov 9 '12 at 8:45
    
Try with features=arabic in definesimplefonts (see updates answer). –  Aditya Nov 10 '12 at 22:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.