#include "lyxfont.h"
#include "FontLoader.h"
#include "font.h"
+#include "math_cursor.h"
#include "math_defs.h"
#include "math_inset.h"
#include "math_parser.h"
void mathed_init_fonts()
{
- MathFonts = new LyXFont[FONT_NUM]; //DEC cxx cannot initialize all fonts
- //at once (JMarc) rc
-
- for (int i = 0 ; i < FONT_NUM ; ++i) {
- MathFonts[i] = LyXFont(LyXFont::ALL_SANE);
- }
+ MathFonts = new LyXFont[FONT_NUM];
MathFonts[FONT_IT].setShape(LyXFont::ITALIC_SHAPE);
case LM_TC_TT:
return MathFonts[FONT_TT];
+ case LM_TC_BOX:
case LM_TC_TEXTRM:
case LM_TC_CONST:
case LM_TC_TEX:
return MathFonts[1];
}
+
LyXFont const & whichFontBase(MathTextCodes type)
{
if (!MathFonts)
break;
}
- if (type != LM_TC_TEXTRM)
+ if (type != LM_TC_TEXTRM && type != LM_TC_BOX)
f.setColor(LColor::math);
if (type == LM_TC_TEX)
}
+void mathed_draw_framebox(Painter & pain, int x, int y, MathInset const * p)
+{
+ if (mathcursor && mathcursor->isInside(p))
+ pain.rectangle(x, y - p->ascent(), p->width(), p->height(),
+ LColor::mathframe);
+}
+
+
// In the future maybe we use a better fonts renderer
void drawStr(Painter & pain, MathTextCodes type, MathMetricsInfo const & siz,
int x, int y, string const & s)
};
+char const * latex_mathstyle[] = {
+ "textstyle", "displaystyle", "scriptstyle", "scriptscriptstyle",
+ "mathbf", "mathcal","mathrm","mathtt", "mathsf", "mathit",
+ "mathbb","mathfrak", "textrm", "mathnormal"
+};
+
+
char const * math_font_name(MathTextCodes code)
{
static char const * theFontNames[] = {