]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_support.C
more IU
[lyx.git] / src / mathed / math_support.C
index e55c9286f4ea59f58d7527ce0a6b736e6b405a5a..148d33e54e870624a84c5f232618872533293583 100644 (file)
 #include <config.h>
 
 #include "math_support.h"
-
 #include "math_data.h"
+#include "math_inset.h"
 #include "math_mathmlstream.h"
 #include "math_parser.h"
 
 #include "debug.h"
+#include "LColor.h"
 
 #include "frontends/Painter.h"
 #include "frontends/font_metrics.h"
@@ -27,6 +28,8 @@
 
 #include <map>
 
+
+using std::string;
 using std::max;
 using std::endl;
 
@@ -532,8 +535,8 @@ LyXFont::FONT_SHAPE  const inh_shape  = LyXFont::INHERIT_SHAPE;
 // does not work
 fontinfo fontinfos[] = {
        // math fonts
-       {"mathnormal",    inh_family, LyXFont::MEDIUM_SERIES,
-                         LyXFont::UP_SHAPE, LColor::math},
+       {"mathnormal",    LyXFont::ROMAN_FAMILY, LyXFont::MEDIUM_SERIES,
+                         LyXFont::ITALIC_SHAPE, LColor::math},
        {"mathbf",        inh_family, LyXFont::BOLD_SERIES,
                          inh_shape, LColor::math},
        {"mathcal",       LyXFont::CMSY_FAMILY, inh_series,
@@ -541,13 +544,15 @@ fontinfo fontinfos[] = {
        {"mathfrak",      LyXFont::EUFRAK_FAMILY, inh_series,
                          inh_shape, LColor::math},
        {"mathrm",        LyXFont::ROMAN_FAMILY, inh_series,
-                         inh_shape, LColor::math},
+                         LyXFont::UP_SHAPE, LColor::math},
        {"mathsf",        LyXFont::SANS_FAMILY, inh_series,
                          inh_shape, LColor::math},
        {"mathbb",        LyXFont::MSB_FAMILY, inh_series,
                          inh_shape, LColor::math},
        {"mathtt",        LyXFont::TYPEWRITER_FAMILY, inh_series,
                          inh_shape, LColor::math},
+       {"mathit",        inh_family, inh_series,
+                         LyXFont::ITALIC_SHAPE, LColor::math},
        {"cmex",          LyXFont::CMEX_FAMILY, inh_series,
                          inh_shape, LColor::none},
        {"cmm",           LyXFont::CMM_FAMILY, inh_series,
@@ -595,15 +600,13 @@ fontinfo fontinfos[] = {
 
        // LyX internal usage
        {"lyxtex",        inh_family, inh_series,
-                         inh_shape, LColor::latex},
+                         LyXFont::UP_SHAPE, LColor::latex},
        {"lyxert",        LyXFont::TYPEWRITER_FAMILY, inh_series,
-                         inh_shape, LColor::latex},
+                         LyXFont::UP_SHAPE, LColor::latex},
        {"lyxsymbol",     LyXFont::SYMBOL_FAMILY, inh_series,
                          inh_shape, LColor::math},
        {"lyxboldsymbol", LyXFont::SYMBOL_FAMILY, LyXFont::BOLD_SERIES,
                          inh_shape, LColor::math},
-       {"lyxitsymbol",   LyXFont::SYMBOL_FAMILY, inh_series,
-                    LyXFont::ITALIC_SHAPE, LColor::math},
        {"lyxblacktext",  LyXFont::ROMAN_FAMILY, LyXFont::MEDIUM_SERIES,
                     LyXFont::UP_SHAPE, LColor::foreground},
        {"lyxnochange",   inh_family, inh_series,
@@ -697,7 +700,7 @@ string asString(MathArray const & ar)
        std::ostringstream os;
        WriteStream ws(os);
        ws << ar;
-       return STRCONV(os.str());
+       return os.str();
 }
 
 
@@ -705,3 +708,21 @@ void asArray(string const & str, MathArray & ar)
 {
        mathed_parse_cell(ar, str);
 }
+
+
+string asString(MathInset const & inset)
+{
+       std::ostringstream os;
+       WriteStream ws(os);
+       inset.write(ws);
+       return os.str();
+}
+
+
+string asString(MathAtom const & at)
+{
+       std::ostringstream os;
+       WriteStream ws(os);
+       at->write(ws);
+       return os.str();
+}