]> git.lyx.org Git - lyx.git/blobdiff - src/Font.cpp
Forgot this part.
[lyx.git] / src / Font.cpp
index 941f94a36c49822591ccd045684a7f8e49c5c5e2..c344ac9ea8155a458b3d425f617b0061ac699da7 100644 (file)
@@ -228,8 +228,13 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
            && language() != prev.language()) {
                if (!language()->polyglossia().empty()) {
                        string tmp = "\\text" + language()->polyglossia();
-                       if (!language()->polyglossiaOpts().empty())
+                       if (!language()->polyglossiaOpts().empty()) {
                                tmp += "[" + language()->polyglossiaOpts() + "]";
+                               if (runparams.use_hyperref && runparams.moving_arg)
+                                       // We need to strip the command for
+                                       // the pdf string, see #11813
+                                       tmp = "\\texorpdfstring{" + tmp + "}{}";
+                       }
                        tmp += "{";
                        os << from_ascii(tmp);
                        count += tmp.length();
@@ -340,7 +345,7 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
        // the numbers are written Left-to-Right. ArabTeX package
        // and bidi (polyglossia with XeTeX) reorder the number automatically
        // but the packages used for Hebrew and Farsi (Arabi) do not.
-       if (!(runparams.use_polyglossia && runparams.flavor == OutputParams::XETEX)
+       if (!runparams.useBidiPackage()
            && !runparams.pass_thru
            && bits_.number() == FONT_ON
            && prev.fontInfo().number() != FONT_ON
@@ -507,7 +512,7 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
        // the numbers are written Left-to-Right. ArabTeX package
        // and bidi (polyglossia with XeTeX) reorder the number automatically
        // but the packages used for Hebrew and Farsi (Arabi) do not.
-       if (!(runparams.use_polyglossia && runparams.flavor == OutputParams::XETEX)
+       if (!runparams.useBidiPackage()
            && !runparams.pass_thru
            && bits_.number() == FONT_ON
            && next.fontInfo().number() != FONT_ON
@@ -538,8 +543,7 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
 
        if (closeLanguage
            && language() != base.language() && language() != next.language()
-           && (language()->encoding()->package() != Encoding::CJK
-                       || bparams.useNonTeXFonts)) {
+           && (language()->encoding()->package() != Encoding::CJK)) {
                os << '}';
                ++count;
                bool const using_begin_end =
@@ -774,7 +778,7 @@ ostream & operator<<(ostream & os, FontInfo const & f)
 ostream & operator<<(ostream & os, Font const & font)
 {
        return os << font.bits_
-               << " lang: " << (font.lang_ ? font.lang_->lang() : 0);
+               << " lang: " << (font.lang_ ? font.lang_->lang() : nullptr);
 }