]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathSupport.cpp
Revert "XHTML: remove DOCTYPE, as the document is then understood as HTML4/XHTML1...
[lyx.git] / src / mathed / MathSupport.cpp
index a75beec069337e501d433b993adf8a345f71779e..f5278b15d031cc5ca1fe8d3f1f1b9cd667dab7fa 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "InsetMathFont.h"
 #include "InsetMathSymbol.h"
-#include "Length.h"
 #include "MathData.h"
 #include "MathFactory.h"
 #include "MathParser.h"
@@ -31,6 +30,7 @@
 #include "support/debug.h"
 #include "support/docstream.h"
 #include "support/lassert.h"
+#include "support/Length.h"
 #include "support/lyxlib.h"
 
 #include <map>
@@ -692,7 +692,13 @@ int mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym)
                sym->extra == "mathalpha" &&
                mb.fontname == "mathit";
        std::string const font = italic_upcase_greek ? "cmm" : sym->inset;
-       Changer dummy = mb.changeFontSet(font);
+       bool const change_font = font != "cmr" ||
+                               (mb.fontname != "mathbb" &&
+                                mb.fontname != "mathds" &&
+                                mb.fontname != "mathfrak" &&
+                                mb.fontname != "mathcal" &&
+                                mb.fontname != "mathscr");
+       Changer dummy = change_font ? mb.changeFontSet(font) : Changer();
        mathed_string_dim(mb.font, mathedSymbol(mb, sym), dim);
        return mathed_char_kerning(mb.font, mathedSymbol(mb, sym).back());
 }
@@ -710,8 +716,13 @@ void mathedSymbolDraw(PainterInfo & pi, int x, int y, latexkeys const * sym)
                sym->extra == "mathalpha" &&
                pi.base.fontname == "mathit";
        std::string const font = italic_upcase_greek ? "cmm" : sym->inset;
-
-       Changer dummy = pi.base.changeFontSet(font);
+       bool const change_font = font != "cmr" ||
+                               (pi.base.fontname != "mathbb" &&
+                                pi.base.fontname != "mathds" &&
+                                pi.base.fontname != "mathfrak" &&
+                                pi.base.fontname != "mathcal" &&
+                                pi.base.fontname != "mathscr");
+       Changer dummy = change_font ? pi.base.changeFontSet(font) : Changer();
        pi.draw(x, y, mathedSymbol(pi.base, sym));
 }
 
@@ -785,8 +796,6 @@ fontinfo fontinfos[] = {
                          inh_shape, Color_math},
        {"mathds",        DS_FAMILY, inh_series,
                          inh_shape, Color_math},
-       {"mathbbm",       BBM_FAMILY, inh_series,
-                         inh_shape, Color_math},
        {"mathtt",        TYPEWRITER_FAMILY, inh_series,
                          inh_shape, Color_math},
        {"mathit",        inh_family, inh_series,