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 "support/LOstream.h"
14 #include "textpainter.h"
18 MathFontInset::MathFontInset(latexkeys const * key)
19 : MathNestInset(1), key_(key)
23 MathInset * MathFontInset::clone() const
25 return new MathFontInset(*this);
29 MathInset::mode_type MathFontInset::currentMode() const
31 if (key_->extra == "mathmode")
33 if (key_->extra == "textmode")
35 return UNDECIDED_MODE;
39 void MathFontInset::metrics(MathMetricsInfo & mi) const
41 MathFontSetChanger dummy(mi.base, key_->name.c_str());
42 dim_ = cell(0).metrics(mi);
47 void MathFontInset::draw(MathPainterInfo & pi, int x, int y) const
49 MathFontSetChanger dummy(pi.base, key_->name.c_str());
50 cell(0).draw(pi, x + 1, y);
51 drawMarkers(pi, x, y);
55 void MathFontInset::metricsT(TextMetricsInfo const & mi) const
57 dim_ = cell(0).metricsT(mi);
61 void MathFontInset::drawT(TextPainter & pain, int x, int y) const
63 cell(0).drawT(pain, x, y);
67 string MathFontInset::name() const
73 void MathFontInset::validate(LaTeXFeatures & features) const
75 MathNestInset::validate(features);
76 // Make sure amssymb is put in preamble if Blackboard Bold or
78 if (key_->name == "mathfrak" || key_->name == "mathbb")
79 features.require("amssymb");
83 void MathFontInset::infoize(std::ostream & os) const
85 os << "Font: " << key_->name;