Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reversed arabic inside c r l columns with xcolor package table option #28

Closed
seloumi opened this issue Sep 22, 2019 · 5 comments
Closed

Comments

@seloumi
Copy link
Contributor

seloumi commented Sep 22, 2019

Adding xcolor with option table (same with colortbl) Arabic words inside columns c r or l are reversed

complement

The issue apparently appears only with Amiri font may be this is related with this #25

\documentclass[12pt]{book}
\usepackage[table]{xcolor}% or \usepackage{colortbl} 
\usepackage[bidi=basic,layout=lists.tabular]{babel}
\babelprovide[import=ar,mapdigits,main]{arabic}
\babelfont{rm}{Amiri} % no issue with others fonts 
  
\begin{document}
\Huge
\begin{tabular}{c} 
اللغة العربية  \\  
\end{tabular}
\end{document} 

Capture

https://tex.stackexchange.com/q/509234/54817

@u-fischer
Copy link
Member

colortbl inserts the cell content via \unhbox, and it looks as if babel (?) injects a \begindir TLT if unhbox is used:

\documentclass[12pt]{book}
\usepackage[bidi=basic,layout=lists]{babel} \babelprovide[import=ar,mapdigits,main]{arabic}
\babelfont{rm}{Amiri}

\begin{document}
\showoutput
اللغة 

\setbox0\hbox{اللغة}

\copy 0 

\unhbox 0 

\end{document} 

gives

Completed box being shipped out [1]
\vbox(630.3738+0.0)x407.0, direction TRT
.\glue 20.0
.\vbox(610.3738+0.0)x390.0, shifted 17.0, direction TRT
..\vbox(12.0+0.0)x390.0, glue set 5.20898fil, direction TRT
...\glue 0.0 plus 1.0fil
...\hbox(6.79102+1.13672)x390.0, glue set 382.96875fil, direction TRT
....\glue 0.0 plus 1.0fil
....\TU/Amiri(1)/m/n/12 ١
..\glue 19.8738
..\glue(\lineskip) 0.0
..\vbox(548.5+0.0)x390.0, glue set 507.5fil, direction TRT
...\write-{}
...\write1{\babel@aux{arabic}{}}
...\glue(\topskip) 3.36914
...\hbox(8.63086+0.29883)x390.0, glue set 355.875fil, direction TRT
....\localpar
.....\localinterlinepenalty=0
.....\localbrokenpenalty=0
.....\localleftbox=null
.....\localrightbox=null
....\hbox(0.0+0.0)x18.0, direction TRT
....\TU/Amiri(1)/m/n/12 ا
....\TU/Amiri(1)/m/n/12 󰹘
....\TU/Amiri(1)/m/n/12 󰹞
....\TU/Amiri(1)/m/n/12 󰅮
....\TU/Amiri(1)/m/n/12 󰉁
....\penalty 10000
....\glue(\parfillskip) 0.0 plus 1.0fil
....\glue(\rightskip) 0.0
...\glue(\baselineskip) 5.57031
...\hbox(8.63086+0.29883)x16.125, direction TRT
....\TU/Amiri(1)/m/n/12 ا
....\TU/Amiri(1)/m/n/12 󰹘
....\TU/Amiri(1)/m/n/12 󰹞
....\TU/Amiri(1)/m/n/12 󰅮
....\TU/Amiri(1)/m/n/12 󰉁
...\glue(\parskip) 0.0 plus 1.0
...\glue(\baselineskip) 5.57031
...\hbox(8.63086+0.29883)x390.0, glue set 355.875fil, direction TRT
....\localpar
.....\localinterlinepenalty=0
.....\localbrokenpenalty=0
.....\localleftbox=null
.....\localrightbox=null
....\hbox(0.0+0.0)x18.0, direction TRT
....\TU/Amiri(1)/m/n/12 ا
....\begindir TLT                           <----------------
....\TU/Amiri(1)/m/n/12 󰹘
....\TU/Amiri(1)/m/n/12 󰹞
....\TU/Amiri(1)/m/n/12 󰅮
....\TU/Amiri(1)/m/n/12 󰉁
....\enddir TLT
....\penalty 10000
....\glue(\parfillskip) 0.0 plus 1.0fil
....\glue(\rightskip) 0.0
...\glue -0.29883
...\glue 0.0 plus 1.0fil
...\glue 0.0
..\glue(\baselineskip) 30.0
..\hbox(0.0+0.0)x390.0, direction TRT

image

@seloumi
Copy link
Contributor Author

seloumi commented Sep 23, 2019

With another font there isn't \begindir TLT ! and the output is fine.

Completed box being shipped out [1]
\vbox(630.3738+0.0)x407.0, direction TRT
.\glue 20.0
.\vbox(610.3738+0.0)x390.0, shifted 17.0, direction TRT
..\vbox(12.0+0.0)x390.0, glue set 3.4043fil, direction TRT
...\glue 0.0 plus 1.0fil
...\hbox(8.5957+0.0)x390.0, glue set 383.68945fil, direction TRT
....\glue 0.0 plus 1.0fil
....\TU/Arial(1)/m/n/12 ظ،
..\glue 19.8738
..\glue(\lineskip) 0.0
..\vbox(548.5+0.0)x390.0, glue set 507.5fil, direction TRT
...\write-{}
...\write1{\babel@aux{arabic}{}}
...\glue(\topskip) 2.70117
...\hbox(9.29883+0.0)x390.0, glue set 355.31836fil, direction TRT
....\localpar
.....\localinterlinepenalty=0
.....\localbrokenpenalty=0
.....\localleftbox=null
.....\localrightbox=null
....\hbox(0.0+0.0)x18.0, direction TRT
....\TU/Arial(1)/m/n/12 ط§
....\TU/Arial(1)/m/n/12 ï»ں
....\TU/Arial(1)/m/n/12 ï» 
....\TU/Arial(1)/m/n/12 ï»گ
....\TU/Arial(1)/m/n/12 ï؛”
....\penalty 10000
....\glue(\parfillskip) 0.0 plus 1.0fil
....\glue(\rightskip) 0.0
...\glue(\baselineskip) 5.20117
...\hbox(9.29883+0.0)x16.68164, direction TRT
....\TU/Arial(1)/m/n/12 ط§
....\TU/Arial(1)/m/n/12 ï»ں
....\TU/Arial(1)/m/n/12 ï» 
....\TU/Arial(1)/m/n/12 ï»گ
....\TU/Arial(1)/m/n/12 ï؛”
...\glue(\parskip) 0.0 plus 1.0
...\glue(\baselineskip) 5.20117
...\hbox(9.29883+0.0)x390.0, glue set 355.31836fil, direction TRT

@jbezos
Copy link
Contributor

jbezos commented Sep 23, 2019

With \babelcharproperty{980000}[990000]{direction}{al} it seems to work, so, yes, very likely it's related to #25. I wonder if there is a way to know the bidi class of glyphs in the PUA (to be more precise, if the font contains this info).

@car222222
Copy link

"I wonder if there is a way to know the bidi class of glyphs in the PUA" Does this make sense? I thought thta "bidi class" is a Unicode property, so it is a property of a Unicode Character Slot, not of a Font Glyph Slot. Or am I wrong?

@jbezos
Copy link
Contributor

jbezos commented Nov 3, 2019

@car222222 Sure it's a character property. See what I actually meant here: #25 (comment) . Anyway, as Khaled pointed out in the same thread, the PUA is not used by the font, but by luaotfload, so my question didn't make sense anyway (but for other reasons).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants