#include "LaTeXFeatures.h"
#include "support/debug.h"
+#include "support/docstring.h"
#include "support/lassert.h"
#include <ostream>
void InsetMathDecoration::metrics(MetricsInfo & mi, Dimension & dim) const
{
bool const upshape = currentMode() == TEXT_MODE
- && mi.base.font.color() == Color_math;
+ && isMathFont(from_ascii(mi.base.fontname));
ShapeChanger dummy(mi.base.font, upshape ?
UP_SHAPE : mi.base.font.shape());
void InsetMathDecoration::draw(PainterInfo & pi, int x, int y) const
{
bool const upshape = currentMode() == TEXT_MODE
- && pi.base.font.color() == Color_math;
+ && isMathFont(from_ascii(pi.base.fontname));
ShapeChanger dummy(pi.base.font, upshape ?
UP_SHAPE : pi.base.font.shape());
}
+bool isMathFont(docstring const & name)
+{
+ fontinfo * f = lookupFont(name);
+ return f && f->color_ == Color_math;
+}
+
+
FontInfo getFont(docstring const & name)
{
FontInfo font;
bool isFontName(docstring const & name);
+bool isMathFont(docstring const & name);
+
// converts single cell to string
docstring asString(MathData const & ar);
// converts single inset to string