Omikhleia / ptable.sile

Paragraph boxes, framed boxes and table packages for the SILE typesetting system
MIT License
10 stars 2 forks source link

MWE: framebox and RTL issue #10

Open mahmadzaid opened 1 year ago

mahmadzaid commented 1 year ago
\begin[papersize=b6,class=plain]{document}
\use[module=packages.frametricks]
\use[module=packages.framebox]
\use[module=packages.rules]
\use[module=packages.color]
\nofolios
\neverindent
\define[command=sbox]{\framebox[bordercolor=#008000]{\color[color=#8b0000]{\process}}}
\define[command=hlght]{\color[color=#8b0000]{\process}}
\define[command=cmnt]{\breakframevertical\font[size=0.8em]{\color[color=#666666]{\process}}\smallskip}
\define[command=rtlframe]{\breakframevertical\thisframedirection[direction=RTL]}
\define[command=ltrframe]{\breakframevertical}
\font[family="Amiri",size=12pt]

\cmnt{LTR language:}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

\bigskip

\cmnt{LTR}
\ltrframe
Lorem ipsum dolor sit amet, \sbox{consectetur adipiscing} elit, sed do eiusmod tempor \sbox{incididunt} ut labore et dolore magna aliqua.

\bigskip

\cmnt{RTL}
\rtlframe
Lorem ipsum dolor sit amet, \sbox{consectetur adipiscing} elit, sed do eiusmod tempor \sbox{incididunt} ut labore et dolore magna aliqua.

\medskip\fullrule\medskip

\cmnt{RTL language:}
\rtlframe
عندما يريد العالم أن يتكلّم، فهو يتحدّث بلغة \hlght{يونيكود}.

عندما يريد العالم أن يتكلّم، فهو يتحدّث بلغة \hlght{unicode}.

\bigskip

\cmnt{LTR}
\ltrframe
عندما يريد العالم أن يتكلّم، فهو يتحدّث بلغة \hlght{unicode}.

عندما يريد العالم أن يتكلّم، فهو يتحدّث بلغة \sbox{unicode}.

عندما يريد العالم أن يتكلّم، فهو يتحدّث بلغة \sbox{يونيكود}.

\bigskip

\cmnt{RTL}
\rtlframe
عندما يريد العالم أن يتكلّم، فهو يتحدّث بلغة \hlght{unicode}.

عندما يريد العالم أن يتكلّم، فهو يتحدّث بلغة \sbox{unicode}.

عندما يريد العالم أن يتكلّم، فهو يتحدّث بلغة \sbox{يونيكود}.

\end{document}

image

Notice how the highlighted arabic word is rendered with the letters in reverse order.

Omikhleia commented 1 year ago

Doesn't the same issue occur with a mere \hbox or a (from the rules package, deprecated but still there) \boxaround ?

Omikhleia commented 1 year ago

As far as I can tell, it does occur with a mere hbox and stock SILE 0.14.9

image

I am interested in a double-check (I can't read arabic, so I may miss some point), but I'm afraid it's a bug with SILE then. (And whenever fixed, we might have to check this package again, it has some "compatibility shim" still in place for earlier versions of SILE that might need to be revisited too).

But for the time being, it seems to me it's a SILE bug, that should be reported there.

mahmadzaid commented 1 year ago

I'm getting the same results with \hbox, so you're right, it's a SILE bug.

Omikhleia commented 1 year ago

Couldn't find an existing SILE issue that would correspond perfectly, so perhaps can your report it there? You'd be better at simplifying a MWE than I ^^ Note: I'd suggest removing the colors, as there are some issues with them in bidi mode, it seems.

mahmadzaid commented 1 year ago

reported to SILE here https://github.com/sile-typesetter/sile/issues/1796