7 #include "math_braceinset.h"
8 #include "math_parser.h"
9 #include "math_support.h"
10 #include "math_mathmlstream.h"
16 MathBraceInset::MathBraceInset()
21 MathInset * MathBraceInset::clone() const
23 return new MathBraceInset(*this);
27 void MathBraceInset::metrics(MathMetricsInfo const & mi) const
31 whichFont(font_, LM_TC_TEX, mi);
32 mathed_char_dim(font_, '{', a, d, wid_);
33 ascent_ = max(xcell(0).ascent(), a);
34 descent_ = max(xcell(0).descent(), a);
35 width_ = xcell(0).width() + 2 * wid_;
39 void MathBraceInset::draw(Painter & pain, int x, int y) const
41 drawChar(pain, font_, x, y, '{');
42 xcell(0).draw(pain, x + wid_, y);
43 drawChar(pain, font_, x + width_ - wid_, y, '}');
47 void MathBraceInset::write(WriteStream & os) const
49 os << '{' << cell(0) << '}';
53 void MathBraceInset::normalize(NormalStream & os) const
55 os << "[block " << cell(0) << ']';