2001-08-21 14:20:50 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "math_kerninset.h"
|
2001-11-08 12:06:56 +00:00
|
|
|
#include "math_mathmlstream.h"
|
2001-11-08 12:15:12 +00:00
|
|
|
#include "math_support.h"
|
2001-08-21 14:20:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
2001-10-19 11:25:48 +00:00
|
|
|
void MathKernInset::metrics(MathMetricsInfo const &) const
|
2001-08-21 14:20:50 +00:00
|
|
|
{
|
|
|
|
ascent_ = 0;
|
|
|
|
descent_ = 0;
|
|
|
|
#ifdef WITH_WARNINGS
|
|
|
|
#warning fix this once the interface to LyXLength has improved
|
|
|
|
#endif
|
2001-10-19 11:25:48 +00:00
|
|
|
// this uses the numerical valu in pixels, even if the unit is cm or ex!
|
2001-08-21 14:20:50 +00:00
|
|
|
width_ = static_cast<int>(wid_.value());
|
2001-10-19 11:25:48 +00:00
|
|
|
//cerr << "handling kern of width " << wid_.value() << "\n";
|
2001-08-21 14:20:50 +00:00
|
|
|
}
|
2001-11-08 12:06:56 +00:00
|
|
|
|
|
|
|
|
2001-11-09 08:35:57 +00:00
|
|
|
void MathKernInset::write(WriteStream & os) const
|
2001-11-08 12:06:56 +00:00
|
|
|
{
|
|
|
|
os << "\\kern" << wid_.asLatexString().c_str() << " ";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-09 08:35:57 +00:00
|
|
|
void MathKernInset::normalize(NormalStream & os) const
|
2001-11-08 12:06:56 +00:00
|
|
|
{
|
|
|
|
os << "[kern " << wid_.asLatexString().c_str() << "]";
|
|
|
|
}
|
|
|
|
|