On Saturday, June 13th, 2026 at 8:45 PM, Bou Salim <[email protected]> 
wrote:

> Here's an example of mixed English and Arabic text. I defined the 
> `HighlightText` command to highlight the text, but a problem arises in both 
> cases:
>
> 1.  In case of right-to-left text, the command fails with English text (If it 
> is not followed by English text).
> 2.  In case of left-to-right text, the command fails with Arabic text (If it 
> is not followed by Arabic text).
>

The code of textbackground does not consider directions as far as I can tell.

In the file anch-pgr.lmt there is this comment:
 -- this is not yet r2l ready

Udi
On Saturday, June 13th, 2026 at 8:45 PM, Bou Salim <[email protected]> 
wrote:

> Here's an example of mixed English and Arabic text. I defined the 
> `HighlightText` command to highlight the text, but a problem arises in both 
> cases:
> 
> 1.  In case of right-to-left text, the command fails with English text (If it 
> is not followed by English text).
> 2.  In case of left-to-right text, the command fails with Arabic text (If it 
> is not followed by Arabic text).
> 
> ```
> \starttext
> \setupdirections[bidi=global,method=one]
> 
> \definefont[myfont][name:Amiri*arabic at 12pt]
> 
> \definetextbackground[HighlightText][backgroundcolor=yellow, frame=off]
> 
> \startmixedcolumns[n=2]
> \myfont
> 
> \righttoleft
> 
> first word
> \startHighlightText
> second word
> \stopHighlightText
> 
> كلمة أولى
> \startHighlightText
> كلمة ثانية
> \stopHighlightText
> 
> \column
> 
> \lefttoright
> 
> first word
> \startHighlightText
> second word
> \stopHighlightText
> 
> كلمة أولى
> \startHighlightText
> كلمة ثانية
> \stopHighlightText
> 
> \stopmixedcolumns
> 
> \stoptext
> ```
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to