]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
FindAdv: Expand the list of handled chars for ogonek
[lyx.git] / src / Paragraph.cpp
index 0ad14ce353ae664e5c51a155103e10b28270b5ca..58cda931955f342a6c5abbe7858932c0b1d88737 100644 (file)
@@ -924,8 +924,7 @@ int Paragraph::Private::latexSurrogatePair(BufferParams const & bparams,
                length -= pos;
                latex2 = latex2.substr(pos, length);
                // and place it before the accent macro if required (#6463)
-               if (Encodings::needsScriptWrapper(script, fontenc)
-                       || runparams.isFullUnicode()) {
+               if (Encodings::needsScriptWrapper(script, fontenc)) {
                        scriptmacro = from_ascii("\\" + script + "{");
                        cb = from_ascii("}");
                }
@@ -1010,10 +1009,8 @@ int Paragraph::Private::writeScriptChars(BufferParams const & bparams,
        int length = brace2;
        bool closing_brace = true;
        // We only need the script macro with non-native font encodings
-       // and with XeTeX/LuaTeX (with TeX fonts)
-       if (!Encodings::needsScriptWrapper(script, fontenc)
-           && !runparams.isFullUnicode()) {
-               // Correct font encoding is being used, so we can avoid \text[greek|cyr].
+       if (!Encodings::needsScriptWrapper(script, fontenc)) {
+               // Correct font encoding is being used, so we can avoid \text(greek|cyrrillic).
                pos = brace1 + 1;
                length -= pos;
                closing_brace = false;
@@ -1253,7 +1250,7 @@ void Paragraph::Private::latexSpecialChar(otexstream & os,
            && !runparams.isFullUnicode() && bparams.main_font_encoding() == "T1"
            && latexSpecialT1(c, os, i, column))
                return;
-       // NOTE: XeTeX and LuaTeX use EU1/2 (pre 2017) or TU (as of 2017) encoding
+       // NOTE: "fontspec" (non-TeX fonts) sets the font encoding to "TU" (untill 2017 "EU1" or "EU2")
        else if (!runparams.inIPA && !running_font.language()->internalFontEncoding()
                 && runparams.isFullUnicode() && latexSpecialTU(c, os, i, column))
                     return;
@@ -2836,6 +2833,9 @@ void Paragraph::latex(BufferParams const & bparams,
                // such as Note that do not produce any output, so that no
                // command is ever executed but its opening was recorded.
                runparams.inulemcmd = rp.inulemcmd;
+
+               // And finally, pass the post_macros upstream
+               runparams.post_macro = rp.post_macro;
        }
 
        // If we have an open font definition, we have to close it