/// Updates font settings according to request
void Font::update(Font const & newfont,
/// Updates font settings according to request
void Font::update(Font const & newfont,
bool toggleall)
{
bits_.update(newfont.fontInfo(), toggleall);
if (newfont.language() == language() && toggleall)
bool toggleall)
{
bits_.update(newfont.fontInfo(), toggleall);
if (newfont.language() == language() && toggleall)
&& language()->lang() != base.language()->lang()
&& language() != prev.language()) {
if (!language()->polyglossia().empty()) {
&& language()->lang() != base.language()->lang()
&& language() != prev.language()) {
if (!language()->polyglossia().empty()) {
// We need to strip the command for
// the pdf string, see #11813
// We need to strip the command for
// the pdf string, see #11813
} else if (language()->babel() != base.language()->babel() &&
language() != prev.language()) {
if (language()->lang() == "farsi") {
} else if (language()->babel() != base.language()->babel() &&
language() != prev.language()) {
if (language()->lang() == "farsi") {
os << "\\textLR{";
count += 8;
// currently the remaining RTL languages are arabic_arabtex and hebrew
} else if (isRightToLeft() != prev.isRightToLeft()) {
os << "\\textLR{";
count += 8;
// currently the remaining RTL languages are arabic_arabtex and hebrew
} else if (isRightToLeft() != prev.isRightToLeft()) {
os << '\\' << LaTeXFamilySwitchNames[f.family()] << termcmd;
count += strlen(LaTeXFamilySwitchNames[f.family()]) + 1;
} else {
os << '\\' << LaTeXFamilySwitchNames[f.family()] << termcmd;
count += strlen(LaTeXFamilySwitchNames[f.family()]) + 1;
} else {
os << '\\' << LaTeXSeriesSwitchNames[f.series()] << termcmd;
count += strlen(LaTeXSeriesSwitchNames[f.series()]) + 1;
} else {
os << '\\' << LaTeXSeriesSwitchNames[f.series()] << termcmd;
count += strlen(LaTeXSeriesSwitchNames[f.series()]) + 1;
} else {
os << '\\' << LaTeXShapeSwitchNames[f.shape()] << termcmd;
count += strlen(LaTeXShapeSwitchNames[f.shape()]) + 1;
} else {
os << '\\' << LaTeXShapeSwitchNames[f.shape()] << termcmd;
count += strlen(LaTeXShapeSwitchNames[f.shape()]) + 1;
} else {
// because ulem puts every nested group or macro in a box,
// which prevents linebreaks (#8424, #8733)
if (f.underbar() == FONT_ON) {
// because ulem puts every nested group or macro in a box,
// which prevents linebreaks (#8424, #8733)
if (f.underbar() == FONT_ON) {
// We do not close size group in front of
// insets with InheritFont() false (as opposed
// to all other font properties) (#8384)
// We do not close size group in front of
// insets with InheritFont() false (as opposed
// to all other font properties) (#8384)