X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FMathSupport.cpp;h=1d7358abb086563096c30d33bf61e942a1898cae;hb=981e958b9d63930c83b1adced65b75b3d857ac97;hp=5b08f70bd41abdbec3d1a51d0170915464bcdeb7;hpb=f1cba8ff64b369792fd49f5ddf90e8126ab476ac;p=lyx.git diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp index 5b08f70bd4..1d7358abb0 100644 --- a/src/mathed/MathSupport.cpp +++ b/src/mathed/MathSupport.cpp @@ -26,7 +26,6 @@ #include "support/docstream.h" #include -#include using namespace std; @@ -188,16 +187,25 @@ double const hline[] = { double const ddot[] = { - 1, 0.2, 0.5, 0.3, 0.5, - 1, 0.7, 0.5, 0.8, 0.5, + 1, 0.2, 0.5, 0.3, 0.5, + 1, 0.7, 0.5, 0.8, 0.5, 0 }; double const dddot[] = { - 1, 0.1, 0.5, 0.2, 0.5, + 1, 0.1, 0.5, 0.2, 0.5, 1, 0.45, 0.5, 0.55, 0.5, - 1, 0.8, 0.5, 0.9, 0.5, + 1, 0.8, 0.5, 0.9, 0.5, + 0 +}; + + +double const ddddot[] = { + 1, 0.1, 0.5, 0.2, 0.5, + 1, 0.45, 0.5, 0.55, 0.5, + 1, 0.8, 0.5, 0.9, 0.5, + 1, 1.15, 0.5, 1.25, 0.5, 0 }; @@ -279,6 +287,8 @@ named_deco_struct deco_table[] = { {"underleftarrow", arrow, 1 }, {"underrightarrow", arrow, 3 }, {"underleftrightarrow", udarrow, 1 }, + {"undertilde", tilde, 0 }, + {"utilde", tilde, 0 }, // Delimiters {"(", parenth, 0 }, @@ -295,6 +305,8 @@ named_deco_struct deco_table[] = { {"vert", vert, 0 }, {"Vert", Vert, 0 }, {"'", slash, 1 }, + {"<", angle, 0 }, + {">", angle, 2 }, {"\\", slash, 1 }, {"backslash", slash, 1 }, {"langle", angle, 0 }, @@ -313,6 +325,7 @@ named_deco_struct deco_table[] = { // Accents {"ddot", ddot, 0 }, {"dddot", dddot, 0 }, + {"ddddot", ddddot, 0 }, {"hat", angle, 3 }, {"grave", slash, 1 }, {"acute", slash, 0 }, @@ -330,6 +343,8 @@ named_deco_struct deco_table[] = { {"cdots", hline3, 0 }, {"vdots", hline3, 1 }, {"ddots", dline3, 0 }, + {"adots", dline3, 1 }, + {"iddots", dline3, 1 }, {"dotsb", hline3, 0 }, {"dotsc", hline3, 0 }, {"dotsi", hline3, 0 }, @@ -450,7 +465,7 @@ void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h, pi.pain.line( int(x + xx + 0.5), int(y + yy + 0.5), int(x + x2 + 0.5), int(y + y2 + 0.5), - Color_math); + pi.base.font.color()); } else { int xp[32]; int yp[32]; @@ -467,7 +482,7 @@ void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h, yp[j] = int(y + yy + 0.5); // lyxerr << "P[" << j ' ' << xx << ' ' << yy << ' ' << x << ' ' << y << ']'; } - pi.pain.lines(xp, yp, n, Color_math); + pi.pain.lines(xp, yp, n, pi.base.font.color()); } } } @@ -533,6 +548,8 @@ fontinfo fontinfos[] = { inh_shape, Color_math}, {"mathit", inh_family, inh_series, ITALIC_SHAPE, Color_math}, + {"mathscr", RSFS_FAMILY, inh_series, + inh_shape, Color_math}, {"cmex", CMEX_FAMILY, inh_series, inh_shape, Color_math}, {"cmm", CMM_FAMILY, inh_series, @@ -580,6 +597,12 @@ fontinfo fontinfos[] = { {"textipa", inh_family, inh_series, inh_shape, Color_foreground}, + // mhchem support + {"ce", inh_family, inh_series, + inh_shape, Color_foreground}, + {"cf", inh_family, inh_series, + inh_shape, Color_foreground}, + // LyX internal usage {"lyxtex", inh_family, inh_series, UP_SHAPE, Color_latex}, @@ -629,6 +652,20 @@ bool isFontName(docstring const & name) } +bool isMathFont(docstring const & name) +{ + fontinfo * f = lookupFont(name); + return f && f->color_ == Color_math; +} + + +bool isTextFont(docstring const & name) +{ + fontinfo * f = lookupFont(name); + return f && f->color_ == Color_foreground; +} + + FontInfo getFont(docstring const & name) { FontInfo font;