]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathSupport.cpp
Revert "DocBook: make openParTag/closeTag use paragraphs instead of layouts."
[lyx.git] / src / mathed / MathSupport.cpp
index 55b0822068f1c31f725e45f3308008e76c418d8f..45ca4296816d4161b34c2284fa595c1073df39b0 100644 (file)
@@ -673,9 +673,16 @@ void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
 }
 
 
-void mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym)
+docstring const &  mathedSymbol(MetricsBase & mb, latexkeys const * sym)
 {
-       LASSERT((bool)sym, return);
+       return (mb.font.style() == DISPLAY_STYLE && !sym->dsp_draw.empty()) ?
+               sym->dsp_draw : sym->draw;
+}
+
+
+int mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym)
+{
+       LASSERT((bool)sym, return 0);
        //lyxerr << "metrics: symbol: '" << sym->name
        //      << "' in font: '" << sym->inset
        //      << "' drawn as: '" << sym->draw
@@ -686,7 +693,8 @@ void mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym)
                mb.fontname == "mathit";
        std::string const font = italic_upcase_greek ? "cmm" : sym->inset;
        Changer dummy = mb.changeFontSet(font);
-       mathed_string_dim(mb.font, sym->draw, dim);
+       mathed_string_dim(mb.font, mathedSymbol(mb, sym), dim);
+       return mathed_char_kerning(mb.font, mathedSymbol(mb, sym).back());
 }
 
 
@@ -704,7 +712,7 @@ void mathedSymbolDraw(PainterInfo & pi, int x, int y, latexkeys const * sym)
        std::string const font = italic_upcase_greek ? "cmm" : sym->inset;
 
        Changer dummy = pi.base.changeFontSet(font);
-       pi.draw(x, y, sym->draw);
+       pi.draw(x, y, mathedSymbol(pi.base, sym));
 }
 
 
@@ -775,6 +783,8 @@ fontinfo fontinfos[] = {
                          inh_shape, Color_math},
        {"mathbb",        MSB_FAMILY, inh_series,
                          inh_shape, Color_math},
+       {"mathds",        DS_FAMILY, inh_series,
+                         inh_shape, Color_math},
        {"mathtt",        TYPEWRITER_FAMILY, inh_series,
                          inh_shape, Color_math},
        {"mathit",        inh_family, inh_series,