2 * \file InsetMathKern.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "InsetMathKern.h"
15 #include "MathStream.h"
16 #include "MathSupport.h"
18 #include "Dimension.h"
19 #include "MetricsInfo.h"
21 #include "support/docstring.h"
25 InsetMathKern::InsetMathKern(Buffer * buf)
31 InsetMathKern::InsetMathKern(Buffer * buf, Length const & w)
32 : InsetMath(buf), wid_(w)
37 InsetMathKern::InsetMathKern(Buffer * buf, docstring const & s)
38 : InsetMath(buf), wid_(to_utf8(s))
43 Inset * InsetMathKern::clone() const
45 return new InsetMathKern(*this);
49 void InsetMathKern::metrics(MetricsInfo & mi, Dimension & dim) const
53 dim.wid = mi.base.inPixels(wid_);
57 void InsetMathKern::draw(PainterInfo &, int, int) const
61 void InsetMathKern::write(TeXMathStream & os) const
64 os << "\\kern" << ' ';
65 else if (wid_.unit() == Length::MU)
66 os << "\\mkern" << from_utf8(wid_.asLatexString()) << ' ';
68 os << "\\kern" << from_utf8(wid_.asLatexString()) << ' ';
72 void InsetMathKern::normalize(NormalStream & os) const
77 os << "[kern " << from_utf8(wid_.asLatexString()) << ']';
81 void InsetMathKern::infoize2(odocstream & os) const
85 os << ": " << from_utf8(wid_.asLatexString());