View Issue Details

IDProjectCategoryView StatusLast Update
0000947luatexluatex bugpublic2015-10-21 16:55
ReporterKhaled Hosny Assigned ToKhaled Hosny  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Summary0000947: Math accents are displaced in right-to-left mode
DescriptionMath accents in right-to-left mode (i.e. with \mathdir TRT) are misplaced. It seems that the shift applied to the accent box is not correctly applied in this case. This seems to be a bug inherited from Aleph.
TagsNo tags attached.

Activities

Khaled Hosny

2015-09-12 02:34

developer  

math-trt-bug.png (1,277 bytes)   
math-trt-bug.png (1,277 bytes)   

Khaled Hosny

2015-09-12 02:35

developer  

math-trt-bug.tex (57 bytes)

Khaled Hosny

2015-09-27 23:03

developer   ~0001412

The attached mlist.diff patch is an attempt to fix this issue, it works for me with both TFM and OpenType math fonts and should be low risk as it affects only \mathdir TRT.

Khaled Hosny

2015-10-12 17:21

developer  

mlist.diff (999 bytes)   
diff --git a/source/texk/web2c/luatexdir/tex/mlist.w b/source/texk/web2c/luatexdir/tex/mlist.w
index be0cf55..7684dd0 100644
--- a/source/texk/web2c/luatexdir/tex/mlist.w
+++ b/source/texk/web2c/luatexdir/tex/mlist.w
@@ -2128,20 +2128,12 @@ static void do_make_math_accent(pointer q, internal_font_number f, int c,
         if (sa == INT_MIN) {
             sa = half(width(y));        /* just take the center */
         }
-        if (math_direction == dir_TRT) {
-           shift_amount(y) = s + sa - width(y);
-        } else {
-           shift_amount(y) = s - sa;
-        }
+        shift_amount(y) = s - sa;
     } else {
         if (width(y)== 0) {
             shift_amount(y) = s + w;
         } else {
-            if (math_direction == dir_TRT) {
-                shift_amount(y) = s + width(y);
-            } else {
-                shift_amount(y) = s + half(w - width(y));
-            }
+            shift_amount(y) = s + half(w - width(y));
         }
     }
     width(y) = 0;
mlist.diff (999 bytes)   

Khaled Hosny

2015-10-12 17:22

developer   ~0001421

I uploaded a new patch that make sure the change is only applied in TRT mathdr.

Issue History

Date Modified Username Field Change
2015-09-12 02:34 Khaled Hosny New Issue
2015-09-12 02:34 Khaled Hosny File Added: math-trt-bug.png
2015-09-12 02:35 Khaled Hosny File Added: math-trt-bug.tex
2015-09-27 23:01 Khaled Hosny File Added: mlist.diff
2015-09-27 23:03 Khaled Hosny Note Added: 0001412
2015-10-12 17:21 Khaled Hosny File Deleted: mlist.diff
2015-10-12 17:21 Khaled Hosny File Added: mlist.diff
2015-10-12 17:22 Khaled Hosny Note Added: 0001421
2015-10-12 17:41 Khaled Hosny Assigned To => Khaled Hosny
2015-10-12 17:41 Khaled Hosny Status new => resolved
2015-10-12 17:41 Khaled Hosny Resolution open => fixed
2015-10-21 16:55 Hans Hagen Status resolved => closed