lyx_mirror/src/mathed/math_kerninset.C
André Pönitz 50a865b664 some support for TeX's \kern primitive in the parser.
use \kern instead of yesterday's home grown CheatInset


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2569 a592a061-630c-0410-9148-cb99ea01b6c8
2001-08-21 14:20:50 +00:00

55 lines
868 B
C

#ifdef __GNUG__
#pragma implementation
#endif
#include "math_kerninset.h"
#include "support.h"
#include "support/LOstream.h"
MathKernInset::MathKernInset()
{}
MathKernInset::MathKernInset(LyXLength const & w)
: wid_(w)
{}
MathKernInset::MathKernInset(string const & s)
: wid_(s)
{}
MathInset * MathKernInset::clone() const
{
return new MathKernInset(*this);
}
void MathKernInset::draw(Painter &, int, int) const
{}
void MathKernInset::write(std::ostream & os, bool) const
{
os << "\\kern" << wid_.asLatexString() << " ";
}
void MathKernInset::writeNormal(std::ostream & os) const
{
os << "[kern " << wid_.asLatexString() << "]";
}
void MathKernInset::metrics(MathStyles) const
{
ascent_ = 0;
descent_ = 0;
#ifdef WITH_WARNINGS
#warning fix this once the interface to LyXLength has improved
#endif
width_ = static_cast<int>(wid_.value());
}