- save_ = orig_.shape();
- orig_.setShape(shape);
-}
-
-
-ShapeChanger::~ShapeChanger()
-{
- orig_.setShape(save_);
-}
-
-
-
-StyleChanger::StyleChanger(MetricsBase & mb, Styles style)
- : Changer<MetricsBase>(mb)
-{
- static const int diff[4][4] =
- { { 0, 0, -3, -5 },
- { 0, 0, -3, -5 },
- { 3, 3, 0, -2 },
- { 5, 5, 2, 0 } };
- save_ = mb;
- int t = diff[mb.style][style];
- if (t > 0)
- while (t--)
- mb.font.incSize();
- else
- while (t++)
- mb.font.decSize();
- mb.style = style;
-}
-
-
-StyleChanger::~StyleChanger()
-{
- orig_ = save_;
-}
-
-
-
-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(MetricsBase & mb, int w)
- : Changer<MetricsBase>(mb)
-{
- save_ = mb;
- mb.textwidth = w;
-}
-
-
-WidthChanger::~WidthChanger()
-{
- orig_ = save_;
-}
-
-
-
-
-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();