]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/qfont_loader.C
the convert patch
[lyx.git] / src / frontends / qt2 / qfont_loader.C
index 6f1cb146a4991f91f0113bed3a6435214ea13e6a..8353046132bd32ebebb38a77f4cf85c45f808bd0 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "frontends/lyx_gui.h"
 
+#include "support/convert.h"
 #include "support/filetools.h"
 #include "support/lstrings.h"
 #include "support/systemcall.h"
@@ -50,9 +51,9 @@ using std::string;
 #include <ApplicationServices/ApplicationServices.h>
 #endif
 
-namespace {
 
-void addFontPath()
+
+void qfont_loader::addToFontPath()
 {
 #ifdef Q_WS_X11
        string const dir =  OnlyPath(LibFileSearch("xfonts", "fonts.dir"));
@@ -72,6 +73,10 @@ void addFontPath()
                       << endl;
        }
 #endif
+}
+
+void qfont_loader::initFontPath()
+{
 #ifdef Q_WS_MACX
        CFBundleRef  myAppBundle = CFBundleGetMainBundle();
        CFURLRef  myAppResourcesURL, FontsURL;
@@ -101,6 +106,7 @@ void addFontPath()
 #endif
 }
 
+namespace {
 
 struct symbol_font {
        LyXFont::FONT_FAMILY lyx_family;
@@ -310,7 +316,7 @@ qfont_loader::font_info::font_info(LyXFont const & f)
                }
        }
 
-       font.setPointSizeFloat(lyxrc.font_sizes[f.size()]
+       font.setPointSizeFloat(convert<double>(lyxrc.font_sizes[f.size()])
                               * lyxrc.zoom / 100.0);
 
        switch (f.series()) {
@@ -385,13 +391,6 @@ bool qfont_loader::available(LyXFont const & f)
 {
        if (!lyx_gui::use_gui)
                return false;
-#ifdef Q_WS_MACX
-       static bool need_bundle_fonts = true;
-       if (need_bundle_fonts) {
-               addFontPath();
-               need_bundle_fonts = false;
-       }
-#endif
 
        static vector<bool> cache_set(LyXFont::NUM_FAMILIES, false);
        static vector<bool> cache(LyXFont::NUM_FAMILIES, false);
@@ -417,7 +416,7 @@ bool qfont_loader::available(LyXFont const & f)
                        return false;
 
                first_time = false;
-               addFontPath();
+               addToFontPath();
                tmp = getSymbolFont(pat);
                if (tmp.second) {
                        cache[family] = true;