2002-07-17 10:25:33 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include "math_fontoldinset.h"
|
|
|
|
#include "math_mathmlstream.h"
|
|
|
|
#include "math_streamstr.h"
|
|
|
|
#include "math_support.h"
|
|
|
|
#include "math_parser.h"
|
|
|
|
#include "textpainter.h"
|
2002-07-17 11:05:16 +00:00
|
|
|
#include "support/LOstream.h"
|
2002-07-17 10:25:33 +00:00
|
|
|
#include "frontends/Painter.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MathFontOldInset::MathFontOldInset(latexkeys const * key)
|
|
|
|
: MathNestInset(1), key_(key)
|
|
|
|
{
|
|
|
|
//lock(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-06-16 11:49:38 +00:00
|
|
|
InsetBase * MathFontOldInset::clone() const
|
2002-07-17 10:25:33 +00:00
|
|
|
{
|
|
|
|
return new MathFontOldInset(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-06-02 10:03:27 +00:00
|
|
|
void MathFontOldInset::metrics(MetricsInfo & mi, Dimension & dim) const
|
2002-07-17 10:25:33 +00:00
|
|
|
{
|
2003-03-21 14:20:48 +00:00
|
|
|
FontSetChanger dummy(mi.base, key_->name.c_str());
|
2003-05-28 13:22:36 +00:00
|
|
|
cell(0).metrics(mi, dim_);
|
|
|
|
metricsMarkers(1);
|
2003-06-02 10:03:27 +00:00
|
|
|
dim = dim_;
|
2002-07-17 10:25:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-03-21 14:20:48 +00:00
|
|
|
void MathFontOldInset::draw(PainterInfo & pi, int x, int y) const
|
2002-07-17 10:25:33 +00:00
|
|
|
{
|
2003-03-21 14:20:48 +00:00
|
|
|
FontSetChanger dummy(pi.base, key_->name.c_str());
|
2002-08-02 14:29:42 +00:00
|
|
|
cell(0).draw(pi, x + 1, y);
|
2002-07-17 10:25:33 +00:00
|
|
|
drawMarkers(pi, x, y);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-05-28 13:22:36 +00:00
|
|
|
void MathFontOldInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
|
2002-07-17 10:25:33 +00:00
|
|
|
{
|
2003-05-28 13:22:36 +00:00
|
|
|
cell(0).metricsT(mi, dim);
|
2002-07-17 10:25:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathFontOldInset::drawT(TextPainter & pain, int x, int y) const
|
|
|
|
{
|
2002-08-02 14:29:42 +00:00
|
|
|
cell(0).drawT(pain, x, y);
|
2002-07-17 10:25:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathFontOldInset::write(WriteStream & os) const
|
|
|
|
{
|
|
|
|
os << "{\\" << key_->name << ' ' << cell(0) << '}';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathFontOldInset::normalize(NormalStream & os) const
|
|
|
|
{
|
2002-11-27 10:30:28 +00:00
|
|
|
os << "[font " << key_->name << ' ' << cell(0) << ']';
|
2002-07-17 10:25:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathFontOldInset::infoize(std::ostream & os) const
|
|
|
|
{
|
|
|
|
os << "Font: " << key_->name;
|
|
|
|
}
|