[dev-context] \textrule and Bidi

Wolfgang Schuster wolfgang.schuster.lists at gmail.com
Mon Dec 16 22:26:58 CET 2019


Hi,

in RTL text direction the middle and bottom alternatives of \textrule 
extend into the right margin.

\setupalign[righttoleft]

\starttext

\textrule[top]{}

\textrule[middle]{}

\textrule[bottom]{}

\stoptext


A fix for this is to use \naturalvpack instead of \vpack.

%%%% pack-mrl.mkiv
\def\pack_textrule_with_text_nop#1%
   {\ifhmode
      \endgraf
    \fi
    \doifelse{\directtextrulesparameter\c!depthcorrection}\v!on
      \pack_textrule_correct_depth_yes
      \pack_textrule_correct_depth_nop
    \nointerlineskip
-  \noindent\vpack % was \dontleavehmode
+  \noindent\naturalvpack % was \dontleavehmode
      {\color[\directtextrulesparameter\c!rulecolor]
         {\hrule
            \s!depth \directtextrulesparameter\c!rulethickness
            \s!height\zeropoint
            \s!width \availablehsize}}}
%%%%

Wolfgang

-------------- next part --------------
A non-text attachment was scrubbed...
Name: textrule.pdf
Type: application/pdf
Size: 3903 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/dev-context/attachments/20191216/28189cf9/attachment.pdf>


More information about the dev-context mailing list