Fix font and encoding switch problem with directionality change at inset

Also fixes #10110
This commit is contained in:
Juergen Spitzmueller 2020-08-17 13:25:02 +02:00
parent 4d1d07ea10
commit 3aefd7477c

View File

@ -1087,6 +1087,12 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
runparams.local_font = &basefont; 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(); size_t const previous_row_count = os.texrow().rows();
try { try {
@ -2660,7 +2666,8 @@ void Paragraph::latex(BufferParams const & bparams,
} }
// Switch file encoding if necessary (and allowed) // 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 && runparams.encoding->package() != Encoding::none &&
current_font.language()->encoding()->package() != Encoding::none) { current_font.language()->encoding()->package() != Encoding::none) {
pair<bool, int> const enc_switch = pair<bool, int> const enc_switch =