2001-12-05 08:04:20 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2001-08-21 14:20:50 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "math_kerninset.h"
|
2002-03-25 12:11:25 +00:00
|
|
|
#include "math_extern.h"
|
2001-11-08 12:06:56 +00:00
|
|
|
#include "math_mathmlstream.h"
|
2001-12-05 08:04:20 +00:00
|
|
|
#include "math_streamstr.h"
|
2001-11-08 12:15:12 +00:00
|
|
|
#include "math_support.h"
|
2002-03-25 12:11:25 +00:00
|
|
|
#include "font.h"
|
2001-08-21 14:20:50 +00:00
|
|
|
|
2002-01-11 17:57:02 +00:00
|
|
|
|
2001-08-21 14:20:50 +00:00
|
|
|
MathKernInset::MathKernInset()
|
2002-03-25 12:11:25 +00:00
|
|
|
: MathNestInset(1)
|
2001-08-21 14:20:50 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
MathInset * MathKernInset::clone() const
|
|
|
|
{
|
|
|
|
return new MathKernInset(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-03-25 12:11:25 +00:00
|
|
|
void MathKernInset::metrics(MathMetricsInfo const & mi) const
|
2001-08-21 14:20:50 +00:00
|
|
|
{
|
2002-03-25 12:11:25 +00:00
|
|
|
LyXFont font;
|
|
|
|
whichFont(font, LM_TC_TEXTRM, mi);
|
|
|
|
double t;
|
|
|
|
extractNumber(cell(0), t);
|
|
|
|
width_ = int(t * lyxfont::width('m', font));
|
2001-08-21 14:20:50 +00:00
|
|
|
ascent_ = 0;
|
|
|
|
descent_ = 0;
|
|
|
|
}
|
2001-11-08 12:06:56 +00:00
|
|
|
|
|
|
|
|
2002-03-25 12:11:25 +00:00
|
|
|
void MathKernInset::draw(Painter &, int, int) const
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
2001-11-09 08:35:57 +00:00
|
|
|
void MathKernInset::write(WriteStream & os) const
|
2001-11-08 12:06:56 +00:00
|
|
|
{
|
2002-03-25 12:11:25 +00:00
|
|
|
os << "\\lyxkern" << cell(0) << "em ";
|
2001-11-08 12:06:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-09 08:35:57 +00:00
|
|
|
void MathKernInset::normalize(NormalStream & os) const
|
2001-11-08 12:06:56 +00:00
|
|
|
{
|
2002-03-25 12:11:25 +00:00
|
|
|
os << "[lyxkern " << cell(0) << "em]";
|
2001-11-08 12:06:56 +00:00
|
|
|
}
|