]> git.lyx.org Git - lyx.git/blobdiff - src/MetricsInfo.cpp
Increment version to 565 due to add of adobe source pro fonts
[lyx.git] / src / MetricsInfo.cpp
index 60a004573e2d3d61c1c4bc3d4fe71d077f32a8b0..93782f94765882948b245d7959d7965796b44d00 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "mathed/MathSupport.h"
 
+#include "frontends/FontMetrics.h"
 #include "frontends/Painter.h"
 
 #include "support/docstring.h"
@@ -94,6 +95,19 @@ Changer MetricsBase::changeEnsureMath(Inset::mode_type mode)
 }
 
 
+int MetricsBase::inPixels(Length const & len) const
+{
+       FontInfo fi = font;
+       if (len.unit() == Length::MU)
+               // mu is 1/18th of an em in the math symbol font
+               fi.setFamily(SYMBOL_FAMILY);
+       else
+               // Math style is only taken into account in the case of mu
+               fi.setStyle(LM_ST_TEXT);
+       return len.inPixels(textwidth, theFontMetrics(fi).em());
+}
+
+
 /////////////////////////////////////////////////////////////////////////
 //
 // MetricsInfo