]> git.lyx.org Git - features.git/commitdiff
Brackets reversion differs in luabidi (LuaTeX) from bidi (XeTeX)
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 11 Jul 2019 06:25:18 +0000 (08:25 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 11 Jul 2019 15:44:34 +0000 (17:44 +0200)
This amends [195f62ac93/lyxgit]

(cherry picked from commit d3aa1022603b94f101c3fc42a8d9a37cb6dc4432)

src/Paragraph.cpp
status.23x

index 7d484078c631ba07d7cdeae2fdcb82fa7013bb94..d95c53138701e634a53697168fb40b5e8f10d6ea 100644 (file)
@@ -1920,11 +1920,12 @@ char_type Paragraph::getUChar(BufferParams const & bparams,
        // Most likely, we should simply rely on Qt's unicode handling here.
        string const & lang = getFontSettings(bparams, pos).language()->lang();
 
-       // With polyglossia, brackets and stuff need not be reversed in RTL scripts
+       // With polyglossia and XeTeX (bidi), brackets and stuff need not be 
+       // reversed in RTL scripts
        // FIXME: The special casing for Hebrew parens is due to the special
        // handling on input (for Hebrew in e5f42f67d/lyxgit); see #8251.
        char_type uc = c;
-       if (rp.use_polyglossia) {
+       if (rp.use_polyglossia && rp.flavor == OutputParams::XETEX) {
                switch (c) {
                case '(':
                        if (lang == "hebrew")
@@ -1937,6 +1938,19 @@ char_type Paragraph::getUChar(BufferParams const & bparams,
                }
                return uc;
        }
+       // LuaTeX (luabidi) is different
+       if (rp.use_polyglossia && rp.flavor != OutputParams::XETEX) {
+               switch (c) {
+               case '(':
+                       if (lang != "hebrew")
+                               uc = ')';
+                       break;
+               case ')':
+                       if (lang != "hebrew")
+                               uc = '(';
+                       break;
+               }
+       }
 
        // In the following languages, brackets don't need to be reversed.
        // Furthermore, in arabic_arabi, they are transformed to Arabic
index 53d3f96d8fdf2f43f13ffff6a6bb566550b80a84..a6750ea4566e516fa22fbbbfad6518ae3dd73c69 100644 (file)
@@ -74,6 +74,8 @@ What's new
 
 - Fix paragraph alignment with RTL documents and LuaTeX (part of bug 11399).
 
+- Fix direction of brackets with RTL documents and LuaTeX (part of bug 11187).
+
 
 * USER INTERFACE