]> git.lyx.org Git - lyx.git/blob - src/mathed/math_fontoldinset.C
fixes for \xxalignat and old style font changes
[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 "frontends/Painter.h"
14
15
16
17 MathFontOldInset::MathFontOldInset(latexkeys const * key)
18         : MathNestInset(1), key_(key)
19 {
20         //lock(true);
21 }
22
23
24 MathInset * MathFontOldInset::clone() const
25 {
26         return new MathFontOldInset(*this);
27 }
28
29
30 void MathFontOldInset::metrics(MathMetricsInfo & mi) const
31 {
32         MathFontSetChanger dummy(mi.base, key_->name.c_str());
33         dim_ = xcell(0).metrics(mi);
34         metricsMarkers();
35 }
36
37
38 void MathFontOldInset::draw(MathPainterInfo & pi, int x, int y) const
39 {
40         MathFontSetChanger dummy(pi.base, key_->name.c_str());
41         xcell(0).draw(pi, x + 1, y);
42         drawMarkers(pi, x, y);
43 }
44
45
46 void MathFontOldInset::metricsT(TextMetricsInfo const & mi) const
47 {
48         dim_ = xcell(0).metricsT(mi);
49 }
50
51
52 void MathFontOldInset::drawT(TextPainter & pain, int x, int y) const
53 {
54         xcell(0).drawT(pain, x, y);
55 }
56
57
58 void MathFontOldInset::write(WriteStream & os) const
59 {
60         os << "{\\" << key_->name << ' ' << cell(0) << '}';
61 }
62
63
64 void MathFontOldInset::normalize(NormalStream & os) const
65 {
66         os << "[font " << key_->name << " " << cell(0) << "]";
67 }
68
69
70 void MathFontOldInset::infoize(std::ostream & os) const
71 {
72         os << "Font: " << key_->name;
73 }