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 {
}
// Do we need to close the previous font?
+ bool langClosed = false;
if (open_font &&
((current_font != running_font
|| current_font.language() != running_font.language())
}
running_font = basefont;
open_font = false;
+ langClosed = true;
}
// if necessary, close language environment before opening CJK
}
// 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 =
}
} else {
running_font = current_font;
- open_font = true;
+ open_font = !langClosed;
}
}
// hop to end of word
while (last < to && !owner_->isWordSeparator(last)) {
Inset const * inset = owner_->getInset(last);
- if (inset && inset->lyxCode() == SPECIALCHAR_CODE) {
+ if (inset && dynamic_cast<const InsetSpecialChar *>(inset)) {
// check for "invisible" letters such as ligature breaks
odocstringstream os;
inset->toString(os);