5 #include "math_charinset.h"
8 #include "support/LOstream.h"
9 #include "mathed/support.h"
10 #include "math_parser.h"
14 MathCharInset::MathCharInset(char c, MathTextCodes t)
21 MathInset * MathCharInset::clone() const
23 return new MathCharInset(*this);
27 int MathCharInset::ascent() const
29 return mathed_char_ascent(code_, size(), char_);
33 int MathCharInset::descent() const
35 return mathed_char_descent(code_, size(), char_);
39 int MathCharInset::width() const
41 return mathed_char_width(code_, size(), char_);
45 void MathCharInset::metrics(MathStyles st) const
51 void MathCharInset::draw(Painter & pain, int x, int y) const
55 drawChar(pain, code_, size_, x, y, char_);
59 void MathCharInset::write(std::ostream & os, bool) const
61 if (code_ >= LM_TC_RM && code_ <= LM_TC_TEXTRM)
62 os << '\\' << math_font_name[code_ - LM_TC_RM] << '{';
64 if ((code_ == LM_TC_TEX && char_ != '{' && char_ != '}') ||
65 (code_ == LM_TC_SPECIAL))
70 if (code_ >= LM_TC_RM && code_ <= LM_TC_TEXTRM)
75 void MathCharInset::writeNormal(std::ostream & os) const
81 bool MathCharInset::isRelOp() const
83 return char_ == '=' || char_ == '<' || char_ == '>';