]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathFont.cpp
Revert "XHTML: remove DOCTYPE, as the document is then understood as HTML4/XHTML1...
[lyx.git] / src / mathed / InsetMathFont.cpp
index 40623f6ec613fe90d938401e3fb38425230153d6..f199ee5bcf8ad7f719c998539ae27919429a72d7 100644 (file)
@@ -86,16 +86,13 @@ void InsetMathFont::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        Changer dummy = mi.base.changeFontSet(font());
        cell(0).metrics(mi, dim);
-       metricsMarkers(dim);
 }
 
 
 void InsetMathFont::draw(PainterInfo & pi, int x, int y) const
 {
        Changer dummy = pi.base.changeFontSet(font());
-       cell(0).draw(pi, x + 1, y);
-       drawMarkers(pi, x, y);
-       setPosCache(pi, x, y);
+       cell(0).draw(pi, x, y);
 }
 
 
@@ -137,6 +134,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"
@@ -166,9 +165,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"
@@ -192,7 +193,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(MathStream & ms) const
 {
        // FIXME These are not quite right, because they do not nest
        // correctly. A proper fix would presumably involve tracking
@@ -206,9 +207,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"
@@ -220,18 +223,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);
 }