2001-12-05 08:04:20 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2001-08-21 14:20:50 +00:00
|
|
|
|
|
|
|
#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"
|
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-27 10:51:46 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
MathKernInset::MathKernInset(LyXLength const & w)
|
|
|
|
: wid_(w)
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
MathKernInset::MathKernInset(string const & s)
|
|
|
|
: wid_(s)
|
2001-08-21 14:20:50 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
MathInset * MathKernInset::clone() const
|
|
|
|
{
|
|
|
|
return new MathKernInset(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-03-21 14:20:48 +00:00
|
|
|
void MathKernInset::metrics(MetricsInfo & mi) const
|
2001-08-21 14:20:50 +00:00
|
|
|
{
|
2002-10-17 13:15:25 +00:00
|
|
|
dim_.w = wid_.inPixels(0, mathed_char_width(mi.base.font, 'M'));
|
2002-07-11 11:27:24 +00:00
|
|
|
dim_.a = 0;
|
|
|
|
dim_.d = 0;
|
2001-08-21 14:20:50 +00:00
|
|
|
}
|
2001-11-08 12:06:56 +00:00
|
|
|
|
|
|
|
|
2003-03-21 14:20:48 +00:00
|
|
|
void MathKernInset::draw(PainterInfo &, int, int) const
|
2002-03-25 12:11:25 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
2001-11-09 08:35:57 +00:00
|
|
|
void MathKernInset::write(WriteStream & os) const
|
2001-11-08 12:06:56 +00:00
|
|
|
{
|
2002-11-27 10:30:28 +00:00
|
|
|
os << "\\kern" << wid_.asLatexString() << ' ';
|
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-11-27 10:30:28 +00:00
|
|
|
os << "[kern " << wid_.asLatexString() << ']';
|
2001-11-08 12:06:56 +00:00
|
|
|
}
|