}
+InsetMath::mode_type InsetMathDecoration::currentMode() const
+{
+ return key_->name == "underbar" ? TEXT_MODE : MATH_MODE;
+}
+
+
void InsetMathDecoration::metrics(MetricsInfo & mi, Dimension & dim) const
{
+ FontSetChanger dummy(mi.base, currentMode() == TEXT_MODE ?
+ "textnormal" : "mathnormal");
+
cell(0).metrics(mi, dim);
dh_ = 6; //mathed_char_height(LM_TC_VAR, mi, 'I', ascent_, descent_);
void InsetMathDecoration::draw(PainterInfo & pi, int x, int y) const
{
+ FontSetChanger dummy(pi.base, currentMode() == TEXT_MODE ?
+ "textnormal" : "mathnormal");
+
cell(0).draw(pi, x + 1, y);
Dimension const & dim0 = cell(0).dimension(*pi.base.bv);
if (wide())
MathEnsurer ensurer(os);
if (os.fragile() && protect())
os << "\\protect";
- os << '\\' << key_->name << '{' << cell(0) << '}';
+ os << '\\' << key_->name << '{';
+ ModeSpecifier specifier(os, currentMode());
+ os << cell(0) << '}';
}
///
explicit InsetMathDecoration(Buffer * buf, latexkeys const * key);
///
+ mode_type currentMode() const;
+ ///
void draw(PainterInfo &, int x, int y) const;
///
void write(WriteStream & os) const;