3 #include "math_fontinset.h"
4 #include "math_mathmlstream.h"
5 #include "math_streamstr.h"
6 #include "math_support.h"
7 #include "math_parser.h"
8 #include "LaTeXFeatures.h"
9 #include "support/LOstream.h"
10 #include "textpainter.h"
14 MathFontInset::MathFontInset(latexkeys const * key)
15 : MathNestInset(1), key_(key)
19 MathInset * MathFontInset::clone() const
21 return new MathFontInset(*this);
25 MathInset::mode_type MathFontInset::currentMode() const
27 if (key_->extra == "mathmode")
29 if (key_->extra == "textmode")
31 return UNDECIDED_MODE;
35 void MathFontInset::metrics(MetricsInfo & mi, Dimension & dim) const
37 FontSetChanger dummy(mi.base, key_->name.c_str());
38 cell(0).metrics(mi, dim_);
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, Dimension & dim) const
54 cell(0).metricsT(mi, dim_);
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;