X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathKern.cpp;h=d223887e3b6c2d712f0c9a4a1b577dc1e285b70c;hb=5fdc577badb1cb133d6a0dc7d831bb1f82576adb;hp=fddecfe58e27c7cc19b905b8b1c8d674e74149df;hpb=8a0134cc8ce7de41d6d6911a1c4219ca958f2b71;p=lyx.git diff --git a/src/mathed/InsetMathKern.cpp b/src/mathed/InsetMathKern.cpp index fddecfe58e..d223887e3b 100644 --- a/src/mathed/InsetMathKern.cpp +++ b/src/mathed/InsetMathKern.cpp @@ -11,10 +11,12 @@ #include #include "InsetMathKern.h" -#include "MathStream.h" + #include "MathStream.h" #include "MathSupport.h" + #include "Dimension.h" +#include "MetricsInfo.h" #include "support/docstring.h" @@ -47,7 +49,7 @@ void InsetMathKern::metrics(MetricsInfo & mi, Dimension & dim) const { dim.asc = 0; dim.des = 0; - dim.wid = wid_.inPixels(0, mathed_char_width(mi.base.font, 'M')); + dim.wid = wid_.inPixels(mi.base); } @@ -59,6 +61,8 @@ void InsetMathKern::write(WriteStream & os) const { if (wid_.empty()) os << "\\kern" << ' '; + else if (wid_.unit() == Length::MU) + os << "\\mkern" << from_utf8(wid_.asLatexString()) << ' '; else os << "\\kern" << from_utf8(wid_.asLatexString()) << ' '; } @@ -73,9 +77,11 @@ void InsetMathKern::normalize(NormalStream & os) const } -docstring InsetMathKern::mathmlize(MathStream &) const +void InsetMathKern::infoize2(odocstream & os) const { - return docstring(); + os << "Kern"; + if (!wid_.empty()) + os << ": " << from_utf8(wid_.asLatexString()); }