7 #include "math_fontinset.h"
9 #include "math_mathmlstream.h"
10 #include "math_streamstr.h"
11 #include "math_support.h"
12 #include "math_parser.h"
13 #include "LaTeXFeatures.h"
14 #include "textpainter.h"
15 #include "frontends/Painter.h"
19 MathFontInset::MathFontInset(latexkeys const * key)
20 : MathNestInset(1), key_(key)
24 MathInset * MathFontInset::clone() const
26 return new MathFontInset(*this);
30 MathInset::mode_type MathFontInset::currentMode() const
32 if (key_->extra == "mathmode")
34 if (key_->extra == "textmode")
36 return UNDECIDED_MODE;
40 void MathFontInset::metrics(MathMetricsInfo & mi) const
42 MathFontSetChanger dummy(mi.base, key_->name.c_str());
43 dim_ = xcell(0).metrics(mi);
48 void MathFontInset::draw(MathPainterInfo & pi, int x, int y) const
50 //lyxerr << "MathFontInset::draw\n";
51 //MathNestInset::draw(pi, x, y);
52 MathFontSetChanger dummy(pi.base, key_->name.c_str());
53 xcell(0).draw(pi, x + 1, y);
54 drawMarkers(pi, x, y);
58 void MathFontInset::metricsT(TextMetricsInfo const & mi) const
60 dim_ = xcell(0).metricsT(mi);
64 void MathFontInset::drawT(TextPainter & pain, int x, int y) const
66 //lyxerr << "drawing font code: " << code_ << '\n';
67 xcell(0).drawT(pain, x, y);
71 string MathFontInset::name() const
77 void MathFontInset::validate(LaTeXFeatures & features) const
79 // Make sure amssymb is put in preamble if Blackboard Bold or
81 if (key_->name == "mathfrak" || key_->name == "mathbb")
82 features.require("amssymb");
86 void MathFontInset::infoize(std::ostream & os) const
88 os << "Font: " << key_->name;