Brackets reversion differs in luabidi (LuaTeX) from bidi (XeTeX)

This amends [195f62ac93/lyxgit]

(cherry picked from commit d3aa102260)
This commit is contained in:
Juergen Spitzmueller 2019-07-11 08:25:18 +02:00
parent f60f82e7b7
commit f0f4b98c6e
2 changed files with 18 additions and 2 deletions

View 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

View 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