]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathKern.cpp
Coding style
[lyx.git] / src / mathed / InsetMathKern.cpp
1 /**
2  * \file InsetMathKern.cpp
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 "InsetMathKern.h"
14 #include "MathStream.h"
15 #include "MathStream.h"
16 #include "MathSupport.h"
17 #include "Dimension.h"
18
19 #include "support/docstring.h"
20
21 namespace lyx {
22
23 InsetMathKern::InsetMathKern()
24 {
25 }
26
27
28 InsetMathKern::InsetMathKern(Length const & w)
29         : wid_(w)
30 {
31 }
32
33
34 InsetMathKern::InsetMathKern(docstring const & s)
35         : wid_(to_utf8(s))
36 {
37 }
38
39
40 Inset * InsetMathKern::clone() const
41 {
42         return new InsetMathKern(*this);
43 }
44
45
46 void InsetMathKern::metrics(MetricsInfo & mi, Dimension & dim) const
47 {
48         dim.asc = 0;
49         dim.des = 0;
50         dim.wid = wid_.inPixels(0, mathed_char_width(mi.base.font, 'M'));
51 }
52
53
54 void InsetMathKern::draw(PainterInfo &, int, int) const
55 {}
56
57
58 void InsetMathKern::write(WriteStream & os) const
59 {
60         os << "\\kern" << from_utf8(wid_.asLatexString()) << ' ';
61 }
62
63
64 void InsetMathKern::normalize(NormalStream & os) const
65 {
66         os << "[kern " << from_utf8(wid_.asLatexString()) << ']';
67 }
68
69
70 } // namespace lyx