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