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"
15 MathFontInset::MathFontInset(latexkeys const * key)
16 : MathNestInset(1), key_(key)
20 auto_ptr<InsetBase> MathFontInset::clone() const
22 return auto_ptr<InsetBase>(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, Dimension & dim) const
38 FontSetChanger dummy(mi.base, key_->name.c_str());
39 cell(0).metrics(mi, dim_);
45 void MathFontInset::draw(PainterInfo & pi, int x, int y) const
47 FontSetChanger dummy(pi.base, key_->name.c_str());
48 cell(0).draw(pi, x + 1, y);
49 drawMarkers(pi, x, y);
53 void MathFontInset::metricsT(TextMetricsInfo const & mi, Dimension & /*dim*/) const
55 cell(0).metricsT(mi, dim_);
59 void MathFontInset::drawT(TextPainter & pain, int x, int y) const
61 cell(0).drawT(pain, x, y);
65 string MathFontInset::name() const
71 void MathFontInset::validate(LaTeXFeatures & features) const
73 MathNestInset::validate(features);
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;