X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FMathSupport.cpp;h=45ca4296816d4161b34c2284fa595c1073df39b0;hb=21c92c8a129b5f3ff56de33bf2941a25967cffbb;hp=55b0822068f1c31f725e45f3308008e76c418d8f;hpb=62af7ee772f16f154225d2d0b65d77f4376b6001;p=lyx.git diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp index 55b0822068..45ca429681 100644 --- a/src/mathed/MathSupport.cpp +++ b/src/mathed/MathSupport.cpp @@ -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,