]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
Use \babelfonts only if babel >= 3.15 is available.
[lyx.git] / src / Paragraph.cpp
index ab5aeb95ebd0b96cb1b613508119dfbfc58cc435..d129cb403e237662bfc81f496fa113cec6a04454 100644 (file)
@@ -1860,8 +1860,9 @@ char_type Paragraph::getUChar(BufferParams const & bparams,
        char_type c = d->text_[pos];
 
        // Return unchanged character in LTR languages
-       // or if we use poylglossia/bidi.
-       if (rp.use_polyglossia || !getFontSettings(bparams, pos).isRightToLeft())
+       // or if we use poylglossia/bidi (XeTeX).
+       if (rp.useBidiPackage()
+           || !getFontSettings(bparams, pos).isRightToLeft())
                return c;
 
        // Without polyglossia/bidi, we need to account for some special cases.
@@ -1880,7 +1881,8 @@ char_type Paragraph::getUChar(BufferParams const & bparams,
        char_type uc = c;
 
        // 1. In the following languages, parentheses need to be reversed.
-       bool const reverseparens = lang == "hebrew";
+       //    Also with polyglodia/luabidi
+       bool const reverseparens = (lang == "hebrew" || rp.use_polyglossia);
 
        // 2. In the following languages, brackets don't need to be reversed.
        bool const reversebrackets = lang != "arabic_arabtex"
@@ -2245,8 +2247,9 @@ int Paragraph::Private::startTeXParParams(BufferParams const & bparams,
        InsetCode code = ownerCode();
        bool const lastpar = runparams.isLastPar;
        // RTL in classic (PDF)LaTeX (without the Bidi package)
+       // Luabibdi (used by LuaTeX) behaves like classic
        bool const rtl_classic = owner_->getParLanguage(bparams)->rightToLeft()
-               && !runparams.use_polyglossia;
+               && !runparams.useBidiPackage();
 
        switch (curAlign) {
        case LYX_ALIGN_NONE:
@@ -2308,8 +2311,9 @@ bool Paragraph::Private::endTeXParParams(BufferParams const & bparams,
        InsetCode code = ownerCode();
        bool const lastpar = runparams.isLastPar;
        // RTL in classic (PDF)LaTeX (without the Bidi package)
+       // Luabibdi (used by LuaTeX) behaves like classic
        bool const rtl_classic = owner_->getParLanguage(bparams)->rightToLeft()
-               && !runparams.use_polyglossia;
+               && !runparams.useBidiPackage();
 
        switch (curAlign) {
        case LYX_ALIGN_NONE: