From 7b639d2db21287808343d77b547e5ef7eae489d8 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 12 Jan 2019 18:44:52 +0100 Subject: [PATCH] Script wrapper is needed with ASCII encoding --- src/Paragraph.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 82038e37d3..5c8783b324 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -927,7 +927,9 @@ int Paragraph::Private::latexSurrogatePair(BufferParams const & bparams, length -= pos; latex2 = latex2.substr(pos, length); // We only need the script macro with non-native font encodings - if (Encodings::needsScriptWrapper(script, fontenc)) { + // and with ASCII encoding (e.g., XeTeX with TeX fonts) + if (Encodings::needsScriptWrapper(script, fontenc) + && runparams.encoding != encodings.fromLyXName("ascii")) { scriptmacro = from_ascii("\\" + script + "{"); cb = from_ascii("}"); } @@ -1020,7 +1022,10 @@ int Paragraph::Private::writeScriptChars(BufferParams const & bparams, int pos = 0; int length = brace2; bool closing_brace = true; - if (!Encodings::needsScriptWrapper(script, fontenc)) { + // We only need the script macro with non-native font encodings + // and with ASCII encoding (e.g., XeTeX with TeX fonts) + if (!Encodings::needsScriptWrapper(script, fontenc) + && runparams.encoding != encodings.fromLyXName("ascii")) { // Correct font encoding is being used, so we can avoid \text[greek|cyr]. pos = brace1 + 1; length -= pos; -- 2.39.2