]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/xfont_loader.C
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / xfont_loader.C
index 16f0c0b2dd9721ee35e719227224b925f649f955..73703b343b0519b942d8a25be3164feb1630f44c 100644 (file)
@@ -5,29 +5,34 @@
  *
  * \author Asger Alstrup
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
-#include <cmath>       // fabs()
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "xfont_loader.h"
 #include "FontInfo.h"
-#include "gettext.h"
+
 #include "debug.h"
+#include "LColor.h"
 #include "lyxrc.h"     // lyxrc.font_*
-#include "BufferView.h"
-#include "frontends/LyXView.h"
-#include "support/systemcall.h"
+
+#include "frontends/lyx_gui.h"
+
 #include "support/filetools.h"
+#include "support/systemcall.h"
+
+#include "lyx_forms.h"
 
-#include FORMS_H_LOCATION
+#include <algorithm>
+
+using lyx::support::LibFileSearch;
+using lyx::support::OnlyPath;
+using lyx::support::Systemcall;
 
 using std::endl;
+using std::string;
+
 
 // The global fontloader
 xfont_loader fontloader;
@@ -145,12 +150,14 @@ bool addFontPath()
                char ** p = XGetFontPath(fl_get_display(), &n);
                if (std::find(p, p + n, dir) != p + n)
                        return false;
-               lyxerr << "Adding " << dir << " to the font path.\n";
+               lyxerr[Debug::FONT] << "Adding " << dir
+                                   << " to the font path." << endl;
                string const command = "xset fp+ " + dir;
                Systemcall s;
                if (!s.startscript(Systemcall::Wait, command))
                        return true;
-               lyxerr << "Unable to add font path.\n";
+               lyxerr << "Unable to add " << dir << "to the font path."
+                      << endl;
        }
        return false;
 }
@@ -305,7 +312,7 @@ XFontStruct * xfont_loader::doLoad(LyXFont::FONT_FAMILY family,
                                LyXFont::FONT_SHAPE shape,
                                LyXFont::FONT_SIZE size)
 {
-       if (!lyxrc.use_gui) {
+       if (!lyx_gui::use_gui) {
                if (!dummyXFontStructisGood) {
                        // no character specific info
                        dummyXFontStruct.per_char = 0;
@@ -367,7 +374,7 @@ XFontStruct * xfont_loader::doLoad(LyXFont::FONT_FAMILY family,
 
 bool xfont_loader::available(LyXFont const & f)
 {
-       if (!lyxrc.use_gui)
+       if (!lyx_gui::use_gui)
                return false;
 
        if (!fontinfo[f.family()][f.series()][f.realShape()])