#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);
return MathFonts[1];
}
+
LyXFont const & whichFontBase(MathTextCodes type)
{
if (!MathFonts)
// Decorations
{"widehat", angle, 3 },
{"widetilde", tilde, 0 },
+ {"underbar", hline, 0 },
{"underline", hline, 0 },
{"overline", hline, 0 },
{"underbrace", brace, 1 },
}
+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"
+};
+
+char const * latex_mathfontcmds[] = {
+ "font-bold", "font-emph", "font-roman", "font-code", "font-sans",
+ "font-ital", "font-noun", "font-frak", "font-free", "font-default"
+};
+
+
char const * math_font_name(MathTextCodes code)
{
static char const * theFontNames[] = {