]> git.lyx.org Git - lyx.git/blobdiff - src/FontLoader.h
Reduce Michael's buglist.
[lyx.git] / src / FontLoader.h
index 90fab00e6ec8d3855f0e0b9ab28e1c3be10492d2..66e1676068c11b54cb620892b4e68bd305bddf34 100644 (file)
@@ -4,8 +4,8 @@
  * 
  *           LyX, The Document Processor
  *      
- *           Copyright (C) 1997 Asger Alstrup
- *                     and the LyX Team.
+ *           Copyright 1997 Asger Alstrup
+ *          and the LyX Team.
  *
  * ====================================================== */
 
@@ -16,7 +16,7 @@
 #pragma interface
 #endif
 
-#include FORMS_H_LOCATION
+#include <X11/Xlib.h>
 #include "lyxfont.h"
 #include "LString.h"
 
@@ -39,22 +39,24 @@ public:
        void update();
 
        /// Load font
-       XFontStruct* load(LyXFont::FONT_FAMILY family, 
-                         LyXFont::FONT_SERIES series, 
-                         LyXFont::FONT_SHAPE shape, 
-                         LyXFont::FONT_SIZE size)
-       {
-               if (fontstruct[family][series][shape][size]!= 0)
+       XFontStruct * load(LyXFont::FONT_FAMILY family, 
+                          LyXFont::FONT_SERIES series, 
+                          LyXFont::FONT_SHAPE shape, 
+                          LyXFont::FONT_SIZE size) {
+               if (fontstruct[family][series][shape][size] != 0)
                        return fontstruct[family][series][shape][size];
                else
                        return doLoad(family, series, shape, size);
        };
+       /// Do we have anything matching?
+       bool available(LyXFont const & f);
+       
 private:
        /// Array of font structs
-       XFontStruct* fontstruct[4][2][4][10];
+       XFontStruct * fontstruct[LyXFont::NUM_FAMILIES][2][4][10];
 
        /// Array of font infos
-       FontInfo * fontinfo[4][2][4];
+       FontInfo * fontinfo[LyXFont::NUM_FAMILIES][2][4];
 
        /// Reset font handler
        void reset();
@@ -68,9 +70,13 @@ private:
                         LyXFont::FONT_SHAPE shape);
 
        /** Does the actual loading of a font. Updates fontstruct. */
-       XFontStruct* doLoad(LyXFont::FONT_FAMILY family, 
-                           LyXFont::FONT_SERIES series, 
-                           LyXFont::FONT_SHAPE shape, 
-                           LyXFont::FONT_SIZE size);
+       XFontStruct * doLoad(LyXFont::FONT_FAMILY family, 
+                            LyXFont::FONT_SERIES series, 
+                            LyXFont::FONT_SHAPE shape, 
+                            LyXFont::FONT_SIZE size);
 };
+
+///
+extern FontLoader fontloader;
+
 #endif