]> git.lyx.org Git - lyx.git/blob - src/mathed/math_fontoldinset.C
Jean-Marc's fix for wrong descent
[lyx.git] / src / mathed / math_fontoldinset.C
1 #include <config.h>
2
3
4 #include "math_fontoldinset.h"
5 #include "math_mathmlstream.h"
6 #include "math_streamstr.h"
7 #include "math_support.h"
8 #include "math_parser.h"
9 #include "textpainter.h"
10 #include "support/LOstream.h"
11 #include "frontends/Painter.h"
12
13
14
15 MathFontOldInset::MathFontOldInset(latexkeys const * key)
16         : MathNestInset(1), key_(key)
17 {
18         //lock(true);
19 }
20
21
22 MathInset * MathFontOldInset::clone() const
23 {
24         return new MathFontOldInset(*this);
25 }
26
27
28 void MathFontOldInset::metrics(MathMetricsInfo & mi) const
29 {
30         MathFontSetChanger dummy(mi.base, key_->name.c_str());
31         dim_ = cell(0).metrics(mi);
32         metricsMarkers();
33 }
34
35
36 void MathFontOldInset::draw(MathPainterInfo & pi, int x, int y) const
37 {
38         MathFontSetChanger dummy(pi.base, key_->name.c_str());
39         cell(0).draw(pi, x + 1, y);
40         drawMarkers(pi, x, y);
41 }
42
43
44 void MathFontOldInset::metricsT(TextMetricsInfo const & mi) const
45 {
46         dim_ = cell(0).metricsT(mi);
47 }
48
49
50 void MathFontOldInset::drawT(TextPainter & pain, int x, int y) const
51 {
52         cell(0).drawT(pain, x, y);
53 }
54
55
56 void MathFontOldInset::write(WriteStream & os) const
57 {
58         os << "{\\" << key_->name << ' ' << cell(0) << '}';
59 }
60
61
62 void MathFontOldInset::normalize(NormalStream & os) const
63 {
64         os << "[font " << key_->name << ' ' << cell(0) << ']';
65 }
66
67
68 void MathFontOldInset::infoize(std::ostream & os) const
69 {
70         os << "Font: " << key_->name;
71 }