#include "Length.h"
#include "LyXRC.h"
+#include "MetricsInfo.h"
+
+#include "frontends/FontMetrics.h"
#include "support/docstream.h"
}
-void Length::swap(Length & rhs)
-{
- std::swap(val_, rhs.val_);
- std::swap(unit_, rhs.unit_);
-}
-
-
string const Length::asString() const
{
ostringstream os;
? em_width_base
: 10*(dpi/72.27)*zoom;
// A different estimate for em_width is
- // theFontMetrics(FontInfo(sane_font)).width('M')
+ // theFontMetrics(FontInfo(sane_font)).em()
// but this estimate might not be more accurate as the screen font
// is different then the latex font.
}
+int Length::inPixels(MetricsBase const & base) const
+{
+ return inPixels(base.textwidth, theFontMetrics(base.font).em());
+}
+
+
int Length::inBP() const
{
// return any Length value as a one with