]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathFont.cpp
nullptr
[lyx.git] / src / mathed / InsetMathFont.cpp
index 987612361e788e547b3c7faa36f421ae578a2ccc..2a0cb997aa15636665d5df6b046e731b151c8eae 100644 (file)
@@ -58,13 +58,11 @@ InsetMath::mode_type InsetMathFont::currentMode() const
 
 bool InsetMathFont::lockedMode() const
 {
-       if (key_->extra == "forcetext")
-               return true;
-       return false;
+       return key_->extra == "forcetext";
 }
 
 
-void InsetMathFont::write(WriteStream & os) const
+void InsetMathFont::write(TeXMathStream & os) const
 {
        // Close the mode changing command inserted during export if
        // we are going to output another mode changing command that
@@ -134,6 +132,8 @@ void InsetMathFont::validate(LaTeXFeatures & features) const
                        features.require("tipa");
                if (fontname == "ce" || fontname == "cf")
                        features.require("mhchem");
+               if (fontname == "mathds")
+                       features.require("dsfont");
        } else if (features.runparams().math_flavor == OutputParams::MathAsHTML) {
                features.addCSSSnippet(
                        "span.normal{font: normal normal normal inherit serif;}\n"
@@ -163,9 +163,11 @@ void InsetMathFont::htmlize(HtmlStream & os) const
                variant = "normal";
        else if (tag == "frak" || tag == "mathfrak")
                variant = "fraktur";
-       else if (tag == "mathbb" || tag == "mathbf"
-                || tag == "textbf")
+       else if (tag == "mathbf" || tag == "textbf")
                variant = "bold";
+       else if (tag == "mathbb" || tag == "mathbbm"
+                || tag == "mathds")
+               variant = "double-struck";
        else if (tag == "mathcal")
                variant = "script";
        else if (tag == "mathit" || tag == "textsl"
@@ -189,7 +191,7 @@ void InsetMathFont::htmlize(HtmlStream & os) const
 
 
 // The fonts we want to support are listed in lib/symbols
-void InsetMathFont::mathmlize(MathStream & os) const
+void InsetMathFont::mathmlize(MathMLStream & ms) const
 {
        // FIXME These are not quite right, because they do not nest
        // correctly. A proper fix would presumably involve tracking
@@ -203,9 +205,11 @@ void InsetMathFont::mathmlize(MathStream & os) const
                variant = "normal";
        else if (tag == "frak" || tag == "mathfrak")
                variant = "fraktur";
-       else if (tag == "mathbb" || tag == "mathbf"
-                || tag == "textbf")
+       else if (tag == "mathbf" || tag == "textbf")
                variant = "bold";
+       else if (tag == "mathbb" || tag == "mathbbm"
+                || tag == "mathds")
+               variant = "double-struck";
        else if (tag == "mathcal")
                variant = "script";
        else if (tag == "mathit" || tag == "textsl"
@@ -217,18 +221,12 @@ void InsetMathFont::mathmlize(MathStream & os) const
                variant = "monospace";
        // no support at present for textipa, textsc, noun
 
-       if (!variant.empty()) {
-               if (tag == "mathbb") {
-                       os << MTag("mstyle", "class='mathbb' mathvariant='" + variant + "'")
-                          << cell(0)
-                          << ETag("mstyle");
-               } else {
-                       os << MTag("mstyle", "mathvariant='" + variant + "'")
-                                << cell(0)
-                                << ETag("mstyle");
-               }
-       } else
-               os << cell(0);
+       if (!variant.empty())
+               ms << MTag("mstyle", "mathvariant='" + variant + "'")
+                  << cell(0)
+                  << ETag("mstyle");
+       else
+               ms << cell(0);
 }