]> git.lyx.org Git - features.git/commitdiff
Fix display of parenthesis in arabic
authorJean-Marc <lasgouttes@lyx.org>
Mon, 21 Jul 2014 21:57:10 +0000 (23:57 +0200)
committerJean-Marc <lasgouttes@lyx.org>
Fri, 25 Jul 2014 17:59:37 +0000 (19:59 +0200)
Actually the workaround that is used to show parenthesis in the right direction
is not needed any more, since this is part of the unicode bidi writing algorithm.

This fixes at the same time the use of [] or  as delimiters in arabic, which was wrong on screen.

Note that there is a problem with hebrew, but this will require a fileformat change.

00README_STR_METRICS_BRANCH
src/rowpainter.cpp

index 342d2f65833e14ba67173cc7e74f8d87cbcad684..0416ed48dde8d9cd09913c628786650c81a334c7 100644 (file)
@@ -47,3 +47,5 @@ What is done:
   rely on Qt to do handle complex scripts.
 
 * Get rid of LyXRC::rtl_support, which does not have a real use case.
+
+* Fix display of [] and {} delimiters in Arabic scripts.
index 8c8ac4c25f6fcbf8d3b989b18593fef62c47b5f2..5bd3209439634154ac3340bf71028d7fcd87abd6 100644 (file)
@@ -166,24 +166,9 @@ void RowPainter::paintChars(pos_type & vpos, Font const & font)
        pos_type pos = bidi_.vis2log(vpos);
        pos_type start_pos = pos;
        // first character
-       char_type c = par_.getChar(pos);
        docstring str;
        str.reserve(100);
-
-       // special case for arabic
-       string const & lang = font.language()->lang();
-       bool const swap_paren = lang == "arabic_arabtex"
-               || lang == "arabic_arabi"
-               || lang == "farsi";
-
-       // FIXME: Why only round brackets and why the difference to
-       // Hebrew? See also Paragraph::getUChar
-       if (swap_paren) {
-               if (c == '(')
-                       c = ')';
-               else if (c == ')')
-                       c = '(';
-       }
+       char_type const c = par_.getChar(pos);
        str.push_back(c);
 
        FontSpan const font_span = par_.fontSpan(pos);
@@ -212,7 +197,7 @@ void RowPainter::paintChars(pos_type & vpos, Font const & font)
                        // Track change type or author has changed.
                        break;
 
-               char_type c = par_.getChar(pos);
+               char_type const c = par_.getChar(pos);
 
                if (c == '\t')
                        break;
@@ -220,15 +205,6 @@ void RowPainter::paintChars(pos_type & vpos, Font const & font)
                if (!isPrintableNonspace(c))
                        break;
 
-               // FIXME: Why only round brackets and why the difference to
-               // Hebrew? See also Paragraph::getUChar
-               if (swap_paren) {
-                       if (c == '(')
-                               c = ')';
-                       else if (c == ')')
-                               c = '(';
-               }
-
                str.push_back(c);
        }