2003-08-19 13:00:56 +00:00
|
|
|
/**
|
2007-04-25 03:01:35 +00:00
|
|
|
* \file InsetMathFontOld.cpp
|
2003-08-19 13:00:56 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2003-08-19 13:00:56 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
2002-07-17 10:25:33 +00:00
|
|
|
|
2003-08-19 13:00:56 +00:00
|
|
|
#include <config.h>
|
2002-07-17 10:25:33 +00:00
|
|
|
|
2006-09-17 09:14:18 +00:00
|
|
|
#include "InsetMathFontOld.h"
|
2007-11-05 23:46:17 +00:00
|
|
|
|
2007-04-26 16:05:57 +00:00
|
|
|
#include "MathData.h"
|
2006-10-22 10:15:23 +00:00
|
|
|
#include "MathStream.h"
|
2006-09-17 09:14:18 +00:00
|
|
|
#include "MathParser.h"
|
2007-11-05 23:46:17 +00:00
|
|
|
#include "MetricsInfo.h"
|
|
|
|
|
2008-05-06 10:36:32 +00:00
|
|
|
#include <ostream>
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
2009-11-08 11:45:46 +00:00
|
|
|
InsetMathFontOld::InsetMathFontOld(Buffer * buf, latexkeys const * key)
|
|
|
|
: InsetMathNest(buf, 1), key_(key)
|
2002-07-17 10:25:33 +00:00
|
|
|
{
|
|
|
|
//lock(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-30 18:03:17 +00:00
|
|
|
Inset * InsetMathFontOld::clone() const
|
2002-07-17 10:25:33 +00:00
|
|
|
{
|
2007-08-30 18:03:17 +00:00
|
|
|
return new InsetMathFontOld(*this);
|
2002-07-17 10:25:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-21 20:39:47 +00:00
|
|
|
void InsetMathFontOld::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());
|
2004-01-30 11:41:12 +00:00
|
|
|
cell(0).metrics(mi, dim);
|
|
|
|
metricsMarkers(dim);
|
2002-07-17 10:25:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
void InsetMathFontOld::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);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
void InsetMathFontOld::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
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
void InsetMathFontOld::drawT(TextPainter & pain, int x, int y) const
|
2002-07-17 10:25:33 +00:00
|
|
|
{
|
2002-08-02 14:29:42 +00:00
|
|
|
cell(0).drawT(pain, x, y);
|
2002-07-17 10:25:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
void InsetMathFontOld::write(WriteStream & os) const
|
2002-07-17 10:25:33 +00:00
|
|
|
{
|
|
|
|
os << "{\\" << key_->name << ' ' << cell(0) << '}';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
void InsetMathFontOld::normalize(NormalStream & os) const
|
2002-07-17 10:25:33 +00:00
|
|
|
{
|
2002-11-27 10:30:28 +00:00
|
|
|
os << "[font " << key_->name << ' ' << cell(0) << ']';
|
2002-07-17 10:25:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-10-22 10:15:23 +00:00
|
|
|
void InsetMathFontOld::infoize(odocstream & os) const
|
2002-07-17 10:25:33 +00:00
|
|
|
{
|
|
|
|
os << "Font: " << key_->name;
|
|
|
|
}
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|