]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gtk/xftFontLoader.C
the convert patch
[lyx.git] / src / frontends / gtk / xftFontLoader.C
index 21b7a522b090ad3e470309db5cc1089afe33faec..3024b63dffa842bb7c977b411958de059ec150b2 100644 (file)
@@ -9,24 +9,33 @@
  */
 
 #include <config.h>
-#include <gtkmm.h>
-#include <cmath>       // fabs()
 
-#include <X11/Xft/Xft.h>
+// Too hard to make concept checks work with this file
+#ifdef _GLIBCPP_CONCEPT_CHECKS
+#undef _GLIBCPP_CONCEPT_CHECKS
+#endif
+
 #include "xftFontLoader.h"
 #include "FontInfo.h"
 #include "gettext.h"
 #include "debug.h"
 #include "lyxrc.h"     // lyxrc.font_*
 #include "BufferView.h"
+#include "GtkmmX.h"
+
 #include "frontends/LyXView.h"
+#include "frontends/lyx_gui.h"
+
+#include "support/convert.h"
+#include "support/lstrings.h"
 #include "support/systemcall.h"
 #include "support/filetools.h"
-#include "GtkmmX.h"
+
+#include <cmath>       // fabs()
 #include <vector>
-#include "frontends/lyx_gui.h"
 
 using std::endl;
+using std::string;
 
 // The global fontLoader
 xftFontLoader fontLoader;
@@ -121,7 +130,7 @@ XftPattern * xftFontLoader::getFontPattern(LyXFont::FONT_FAMILY family,
        string ffamily;
        int fweight;
        int fslant;
-       double fsize = lyxrc.font_sizes[size] * lyxrc.zoom / 100.0;
+       double fsize = convert<double>(lyxrc.font_sizes[size]) * lyxrc.zoom / 100.0;
        XftPattern *fpat = XftPatternCreate();
 
        ffamily = familyString(family);
@@ -166,10 +175,10 @@ XftFont * xftFontLoader::doLoad(LyXFont::FONT_FAMILY family,
                               LyXFont::FONT_SHAPE shape,
                               LyXFont::FONT_SIZE size)
 {
-       XftPattern *fpat = getFontPattern(family, series, shape, size);
+       XftPattern * fpat = getFontPattern(family, series, shape, size);
        XftResult result;
-       XftPattern *fpat2 = XftFontMatch(getDisplay(), getScreen(),
-                                        fpat, &result);
+       XftPattern * fpat2 = XftFontMatch(getDisplay(), getScreen(),
+                                         fpat, &result);
        XftFont * font = XftFontOpenPattern(getDisplay(), fpat2);
        fonts_[family][series][shape][size] = font;
        return font;
@@ -192,11 +201,11 @@ bool xftFontLoader::available(LyXFont const & f)
        string const ffamily = familyString(family);
        if (isSpecial(f)) {
                cache_set[family] = true;
-               XftPattern *fpat = XftPatternCreate();
+               XftPattern * fpat = XftPatternCreate();
                XftPatternAddString(fpat, XFT_FAMILY, ffamily.c_str());
                XftResult result;
-               XftPattern *fpat2 = XftFontMatch(getDisplay(), getScreen(),
-                                                fpat, &result);
+               XftPattern * fpat2 = XftFontMatch(getDisplay(), getScreen(),
+                                                 fpat, &result);
                XftPatternDestroy(fpat);
                char * familyM;
                XftPatternGetString(fpat2, XFT_FAMILY, 0, &familyM);