[LyX/master] Fix font and encoding switch problem with directionality change at inset

Juergen Spitzmueller spitz at lyx.org
Mon Aug 17 10:59:53 UTC 2020


commit 3aefd7477c343b2e4526b6965f2c24664dbfba62
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Mon Aug 17 13:25:02 2020 +0200

    Fix font and encoding switch problem with directionality change at inset
    
    Also fixes #10110
---
 src/Paragraph.cpp |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 8e10eda..8ef7c20 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1087,6 +1087,12 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
 			runparams.local_font = &basefont;
 	}
 
+	if (fontswitch_inset && !closeLanguage && fontswitch_inset) {
+		// The directionality has been switched at inset.
+		// Force markup inside.
+		runparams.local_font = &basefont;
+	}
+
 	size_t const previous_row_count = os.texrow().rows();
 
 	try {
@@ -2660,7 +2666,8 @@ void Paragraph::latex(BufferParams const & bparams,
 		}
 
 		// Switch file encoding if necessary (and allowed)
-		if (!runparams.pass_thru && !style.pass_thru &&
+		if ((!fontswitch_inset || closeLanguage)
+		    && !runparams.pass_thru && !style.pass_thru &&
 		    runparams.encoding->package() != Encoding::none &&
 		    current_font.language()->encoding()->package() != Encoding::none) {
 			pair<bool, int> const enc_switch =


More information about the lyx-cvs mailing list