4 #include "math_fontinset.h"
5 #include "math_mathmlstream.h"
6 #include "math_streamstr.h"
7 #include "math_support.h"
8 #include "math_parser.h"
9 #include "LaTeXFeatures.h"
10 #include "support/LOstream.h"
11 #include "textpainter.h"
15 MathFontInset::MathFontInset(latexkeys const * key)
16 : MathNestInset(1), key_(key)
20 MathInset * MathFontInset::clone() const
22 return new MathFontInset(*this);
26 MathInset::mode_type MathFontInset::currentMode() const
28 if (key_->extra == "mathmode")
30 if (key_->extra == "textmode")
32 return UNDECIDED_MODE;
36 void MathFontInset::metrics(MetricsInfo & mi) const
38 FontSetChanger dummy(mi.base, key_->name.c_str());
39 dim_ = cell(0).metrics(mi);
44 void MathFontInset::draw(PainterInfo & pi, int x, int y) const
46 FontSetChanger dummy(pi.base, key_->name.c_str());
47 cell(0).draw(pi, x + 1, y);
48 drawMarkers(pi, x, y);
52 void MathFontInset::metricsT(TextMetricsInfo const & mi) const
54 dim_ = cell(0).metricsT(mi);
58 void MathFontInset::drawT(TextPainter & pain, int x, int y) const
60 cell(0).drawT(pain, x, y);
64 string MathFontInset::name() const
70 void MathFontInset::validate(LaTeXFeatures & features) const
72 MathNestInset::validate(features);
73 // Make sure amssymb is put in preamble if Blackboard Bold or
75 if (key_->name == "mathfrak" || key_->name == "mathbb")
76 features.require("amssymb");
80 void MathFontInset::infoize(std::ostream & os) const
82 os << "Font: " << key_->name;