]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_support.C
enable direct input of #1...#9; some whitespace changes
[lyx.git] / src / mathed / math_support.C
index f3d5a0b3d5c9725bc827ad4df219070f89446a2f..59daa5128653c05876345cd637219600d2309dc3 100644 (file)
@@ -6,6 +6,7 @@
 #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"
@@ -85,12 +86,7 @@ enum MathFont {
 
 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);
 
@@ -190,6 +186,7 @@ LyXFont const & whichFontBaseIntern(MathTextCodes type)
        return MathFonts[1];
 }
 
+
 LyXFont const & whichFontBase(MathTextCodes type)
 {
        if (!MathFonts)
@@ -458,6 +455,7 @@ named_deco_struct deco_table[] = {
        // Decorations
        {"widehat",        angle,      3 },
        {"widetilde",      tilde,      0 },
+       {"underbar",       hline,      0 },
        {"underline",      hline,      0 },
        {"overline",       hline,      0 },
        {"underbrace",     brace,      1 },
@@ -714,6 +712,14 @@ void mathed_draw_deco(Painter & pain, int x, int y, int w, int h,
 }
 
 
+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)
@@ -771,6 +777,16 @@ char const * latex_mathspace[] = {
 };
 
 
+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[] = {