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)
19 MathInset * MathCharInset::clone() const
21 return new MathCharInset(*this);
25 int MathCharInset::ascent() const
27 return mathed_char_ascent(code_, size(), char_);
31 int MathCharInset::descent() const
33 return mathed_char_descent(code_, size(), char_);
37 int MathCharInset::width() const
39 return mathed_char_width(code_, size(), char_);
43 void MathCharInset::metrics(MathStyles st) const
49 void MathCharInset::draw(Painter & pain, int x, int y) const
53 drawChar(pain, code_, size_, x, y, char_);
57 void MathCharInset::write(std::ostream & os, bool) const
59 if (code_ >= LM_TC_RM && code_ <= LM_TC_TEXTRM)
60 os << '\\' << math_font_name[code_ - LM_TC_RM] << '{';
62 if ((code_ == LM_TC_TEX && char_ != '{' && char_ != '}') ||
63 (code_ == LM_TC_SPECIAL))
68 if (code_ >= LM_TC_RM && code_ <= LM_TC_TEXTRM)
73 void MathCharInset::writeNormal(std::ostream & os) const
79 bool MathCharInset::isRelOp() const
81 return char_ == '=' || char_ == '<' || char_ == '>';
85 void MathCharInset::handleFont(MathTextCodes t)
87 code_ = (code_ == t) ? LM_TC_VAR : t;