]> git.lyx.org Git - lyx.git/blob - src/mathed/math_kerninset.C
updates to latexfeatures stuff; allow empty \document_path
[lyx.git] / src / mathed / math_kerninset.C
1 #include <config.h>
2
3 #ifdef __GNUG__
4 #pragma implementation
5 #endif
6
7 #include "math_kerninset.h"
8 #include "math_mathmlstream.h"
9 #include "math_streamstr.h"
10 #include "math_support.h"
11 #include "lyxrc.h"
12
13 MathKernInset::MathKernInset()
14 {}
15
16
17 MathKernInset::MathKernInset(LyXLength const & w)
18         : wid_(w)
19 {}
20
21
22 MathKernInset::MathKernInset(string const & s)
23         : wid_(s)
24 {}
25
26
27 MathInset * MathKernInset::clone() const
28 {
29         return new MathKernInset(*this);
30 }
31
32
33 void MathKernInset::draw(Painter &, int, int) const
34 {}
35
36
37 void MathKernInset::metrics(MathMetricsInfo const &) const
38 {
39         ascent_  = 0;
40         descent_ = 0;
41 #ifdef WITH_WARNINGS
42 #warning fix this once the interface to LyXLength has improved
43 #endif
44         // this uses the numerical valu in pixels, even if the unit is cm or ex!
45         width_   = static_cast<int>(wid_.value());
46         width_   = (width_*static_cast<int>(lyxrc.zoom))/150;
47         //cerr << "handling kern of width " << wid_.value() << "\n";
48 }
49
50
51 void MathKernInset::write(WriteStream & os) const
52 {
53         os << "\\kern" << wid_.asLatexString() << " ";
54 }
55
56
57 void MathKernInset::normalize(NormalStream & os) const
58 {
59         os << "[kern " << wid_.asLatexString() << "]";
60 }
61