]> git.lyx.org Git - lyx.git/blob - src/mathed/math_kerninset.C
more IU
[lyx.git] / src / mathed / math_kerninset.C
1 /**
2  * \file math_kerninset.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "math_kerninset.h"
14 #include "math_mathmlstream.h"
15 #include "math_streamstr.h"
16 #include "math_support.h"
17 #include "dimension.h"
18
19
20 using std::string;
21 using std::auto_ptr;
22
23
24 MathKernInset::MathKernInset()
25 {}
26
27
28 MathKernInset::MathKernInset(LyXLength const & w)
29         : wid_(w)
30 {}
31
32
33 MathKernInset::MathKernInset(string const & s)
34         : wid_(s)
35 {}
36
37
38 auto_ptr<InsetBase> MathKernInset::clone() const
39 {
40         return auto_ptr<InsetBase>(new MathKernInset(*this));
41 }
42
43
44 void MathKernInset::metrics(MetricsInfo & mi, Dimension & dim) const
45 {
46         dim.wid = wid_.inPixels(0, mathed_char_width(mi.base.font, 'M'));
47         dim.asc = 0;
48         dim.des = 0;
49 }
50
51
52 void MathKernInset::draw(PainterInfo &, int, int) const
53 {}
54
55
56 void MathKernInset::write(WriteStream & os) const
57 {
58         os << "\\kern" << wid_.asLatexString() << ' ';
59 }
60
61
62 void MathKernInset::normalize(NormalStream & os) const
63 {
64         os << "[kern " << wid_.asLatexString() << ']';
65 }