]> git.lyx.org Git - lyx.git/blob - src/mathed/math_kerninset.C
Jean-Marc's fix for wrong descent
[lyx.git] / src / mathed / math_kerninset.C
1 #include <config.h>
2
3
4 #include "math_kerninset.h"
5 #include "math_extern.h"
6 #include "math_mathmlstream.h"
7 #include "math_streamstr.h"
8 #include "math_support.h"
9
10
11 MathKernInset::MathKernInset()
12 {}
13
14
15 MathKernInset::MathKernInset(LyXLength const & w)
16         : wid_(w)
17 {}
18
19
20 MathKernInset::MathKernInset(string const & s)
21         : wid_(s)
22 {}
23
24
25 MathInset * MathKernInset::clone() const
26 {
27         return new MathKernInset(*this);
28 }
29
30
31 void MathKernInset::metrics(MathMetricsInfo & mi) const
32 {
33         dim_.w = wid_.inPixels(0, mathed_char_width(mi.base.font, 'M'));
34         dim_.a = 0;
35         dim_.d = 0;
36 }
37
38
39 void MathKernInset::draw(MathPainterInfo &, int, int) const
40 {}
41
42
43 void MathKernInset::write(WriteStream & os) const
44 {
45         os << "\\kern" << wid_.asLatexString() << ' ';
46 }
47
48
49 void MathKernInset::normalize(NormalStream & os) const
50 {
51         os << "[kern " << wid_.asLatexString() << ']';
52 }