X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathKern.cpp;h=61ee6ee5b7db7cd7855fb887b1ac3450a4bd7aff;hb=9296344b9a26191a2092d175a51e357ecc35145d;hp=7f990f996842ff99068b19794feb5d72186a6695;hpb=eb065995b10ca55e93c4d465027f40312142dc1d;p=lyx.git diff --git a/src/mathed/InsetMathKern.cpp b/src/mathed/InsetMathKern.cpp index 7f990f9968..61ee6ee5b7 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 = mi.base.inPixels(wid_); } @@ -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,4 +77,12 @@ void InsetMathKern::normalize(NormalStream & os) const } +void InsetMathKern::infoize2(odocstream & os) const +{ + os << "Kern"; + if (!wid_.empty()) + os << ": " << from_utf8(wid_.asLatexString()); +} + + } // namespace lyx