- if (!cond)
- rc->keep();
- else {
- ColorCode oldcolor = font.color();
- string const oldname = fontname;
- fontname = name;
- if (isMathFont(name) || isMathFont(oldname))
- font = sane_font;
- augmentFont(font, name);
- font.setSize(rc->old.font.size());
- if (name != "lyxtex"
- && ((isTextFont(oldname) && oldcolor != Color_foreground)
- || (isMathFont(oldname) && oldcolor != Color_math)))
- font.setColor(oldcolor);
- }
+ ColorCode oldcolor = font.color();
+ string const oldname = fontname;
+ fontname = name;
+ if (isMathFont(name) || isMathFont(oldname))
+ font = sane_font;
+ augmentFont(font, name);
+ font.setSize(rc->old.font.size());
+ font.setStyle(rc->old.font.style());
+ if (name != "lyxtex"
+ && ((isTextFont(oldname) && oldcolor != Color_foreground)
+ || (isMathFont(oldname) && oldcolor != Color_math)))
+ font.setColor(oldcolor);