InsetMathKern is also used for non-mu lengths.

Generalise the fix by moving to Length::inPixels (thanks Jaan-Marc).
This commit is contained in:
Guillaume Munch 2016-11-20 23:10:12 +01:00
parent eacac8bea2
commit a42c315e79
2 changed files with 4 additions and 5 deletions

View File

@ -300,7 +300,10 @@ double Length::inInch(double text_width, double em_width) const
int Length::inPixels(MetricsBase const & base) const
{
return inPixels(base.textwidth, theFontMetrics(base.font).em());
FontInfo fi = base.font;
if (unit_ == Length::MU)
fi.setFamily(SYMBOL_FAMILY);
return inPixels(base.textwidth, theFontMetrics(fi).em());
}

View File

@ -49,11 +49,7 @@ void InsetMathKern::metrics(MetricsInfo & mi, Dimension & dim) const
{
dim.asc = 0;
dim.des = 0;
// match em value used in mathed_*muskip
FontInfo const oldfont = mi.base.font;
mi.base.font.setFamily(SYMBOL_FAMILY);
dim.wid = wid_.inPixels(mi.base);
mi.base.font = oldfont;
}