7 #include "math_fontinset.h"
8 #include "math_mathmlstream.h"
9 #include "math_streamstr.h"
10 #include "math_support.h"
11 #include "math_parser.h"
12 #include "LaTeXFeatures.h"
13 #include "textpainter.h"
17 MathFontInset::MathFontInset(latexkeys const * key)
18 : MathNestInset(1), key_(key)
22 MathInset * MathFontInset::clone() const
24 return new MathFontInset(*this);
28 MathInset::mode_type MathFontInset::currentMode() const
30 if (key_->extra == "mathmode")
32 if (key_->extra == "textmode")
34 return UNDECIDED_MODE;
38 void MathFontInset::metrics(MathMetricsInfo & mi) const
40 MathFontSetChanger dummy(mi.base, key_->name.c_str());
41 dim_ = cell(0).metrics(mi);
46 void MathFontInset::draw(MathPainterInfo & pi, int x, int y) const
48 MathFontSetChanger dummy(pi.base, key_->name.c_str());
49 cell(0).draw(pi, x + 1, y);
50 drawMarkers(pi, x, y);
54 void MathFontInset::metricsT(TextMetricsInfo const & mi) const
56 dim_ = cell(0).metricsT(mi);
60 void MathFontInset::drawT(TextPainter & pain, int x, int y) const
62 cell(0).drawT(pain, x, y);
66 string MathFontInset::name() const
72 void MathFontInset::validate(LaTeXFeatures & features) const
74 // Make sure amssymb is put in preamble if Blackboard Bold or
76 if (key_->name == "mathfrak" || key_->name == "mathbb")
77 features.require("amssymb");
81 void MathFontInset::infoize(std::ostream & os) const
83 os << "Font: " << key_->name;