]> git.lyx.org Git - lyx.git/blobdiff - src/Length.cpp
PDF-form.lyx: add a note
[lyx.git] / src / Length.cpp
index 0deed7481c915f3e2e70b6f2f100c80d7d993d64..2463be8f66c889d37810e907fddbc37d67b5f842 100644 (file)
@@ -17,6 +17,9 @@
 
 #include "Length.h"
 #include "LyXRC.h"
+#include "MetricsInfo.h"
+
+#include "frontends/FontMetrics.h"
 
 #include "support/docstream.h"
 
@@ -197,7 +200,7 @@ int Length::inPixels(int text_width, int em_width_base) const
                ? 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.
 
@@ -288,6 +291,12 @@ int Length::inPixels(int text_width, int em_width_base) const
 }
 
 
+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