- orig_ = save_;
-}
-
-
-/////////////////////////////////////////////////////////////////////////
-//
-// FontSetChanger
-//
-/////////////////////////////////////////////////////////////////////////
-
-FontSetChanger::FontSetChanger(MetricsBase & mb, char const * name)
- : Changer<MetricsBase>(mb)
-{
- save_ = mb;
- FontSize oldsize = save_.font.size();
- mb.fontname = name;
- mb.font = sane_font;
- augmentFont(mb.font, from_ascii(name));
- mb.font.setSize(oldsize);
-}
-
-
-FontSetChanger::FontSetChanger(MetricsBase & mb, docstring const & name)
- : Changer<MetricsBase>(mb)
-{
- save_ = mb;
- FontSize oldsize = save_.font.size();
- mb.fontname = to_utf8(name);
- mb.font = sane_font;
- augmentFont(mb.font, name);
- mb.font.setSize(oldsize);
-}
-
-
-FontSetChanger::~FontSetChanger()
-{
- orig_ = save_;
-}
-
-
-/////////////////////////////////////////////////////////////////////////
-//
-// WidthChanger
-//
-/////////////////////////////////////////////////////////////////////////
-
-WidthChanger::WidthChanger(MetricsBase & mb, int w)
- : Changer<MetricsBase>(mb)
-{
- save_ = mb;
- mb.textwidth = w;
-}
-
-
-WidthChanger::~WidthChanger()
-{
- orig_ = save_;
-}
-
-
-/////////////////////////////////////////////////////////////////////////
-//
-// ColorChanger
-//
-/////////////////////////////////////////////////////////////////////////
-
-ColorChanger::ColorChanger(FontInfo & font, string const & color)
- : Changer<FontInfo, string>(font)
-{
- save_ = lcolor.getFromLyXName(color);
- font.setColor(lcolor.getFromLyXName(color));
+ switch (font.style()) {
+ case LM_ST_DISPLAY:
+ return font.changeStyle(LM_ST_TEXT);
+ case LM_ST_TEXT:
+ return font.changeStyle(LM_ST_SCRIPT);
+ case LM_ST_SCRIPT:
+ case LM_ST_SCRIPTSCRIPT:
+ return font.changeStyle(LM_ST_SCRIPTSCRIPT);
+ }
+ //remove Warning
+ return Changer();