7 #include "math_stringinset.h"
10 #include "support/LOstream.h"
12 #include "math_parser.h"
16 MathStringInset::MathStringInset(string const & s, MathTextCodes t)
21 MathInset * MathStringInset::clone() const
23 return new MathStringInset(*this);
27 int MathStringInset::ascent() const
29 return mathed_string_ascent(code_, mi_, str_);
33 int MathStringInset::descent() const
35 return mathed_string_descent(code_, mi_, str_);
39 int MathStringInset::width() const
41 return mathed_string_width(code_, mi_, str_);
45 void MathStringInset::metrics(MathMetricsInfo const & mi) const
51 void MathStringInset::draw(Painter & pain, int x, int y) const
53 //lyxerr << "drawing '" << str_ << "' code: " << code_ << endl;
54 drawStr(pain, code_, mi_, x, y, str_);
58 void MathStringInset::write(MathWriteInfo & os) const
60 if (math_font_name(code_))
61 os << '\\' << math_font_name(code_) << '{' << str_ << '}';
67 void MathStringInset::writeNormal(std::ostream & os) const
69 os << "[string " << str_ << " " << "mathalpha" << "]";