]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiApplication.C
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / GuiApplication.C
index 47877f8a660f8f60d8fe2870c97f9badb1364ac2..147238249f889ce5e5e6eb04884588bd38847f43 100644 (file)
 #include "qt_helpers.h"
 #include "QLImage.h"
 
-#include "BufferView.h"
-
-// FIXME: this is needed for now because LyXFunc is still constructed
-// there.
-#include "frontends/Application_pimpl.h"
-
 #include "graphics/LoaderQueue.h"
 
 #include "support/lstrings.h"
 #include "support/os.h"
 #include "support/package.h"
 
+#include "BufferView.h"
 #include "lyx_main.h"
 #include "lyxrc.h"
 #include "debug.h"
@@ -164,6 +159,34 @@ void GuiApplication::exit(int status)
 }
 
 
+string const GuiApplication::romanFontName()
+{
+       QFont font;
+       font.setStyleHint(QFont::Serif);
+       font.setFamily("serif");
+
+       return fromqstr(QFontInfo(font).family());
+}
+
+
+string const GuiApplication::sansFontName()
+{
+       QFont font;
+       font.setStyleHint(QFont::SansSerif);
+       font.setFamily("sans");
+
+       return fromqstr(QFontInfo(font).family());
+}
+
+
+string const GuiApplication::typewriterFontName()
+{
+       QFont font;
+       font.setStyleHint(QFont::TypeWriter);
+       font.setFamily("monospace");
+
+       return fromqstr(QFontInfo(font).family());
+}
 
 
 ////////////////////////////////////////////////////////////////////////