]> git.lyx.org Git - lyx.git/blobdiff - src/FontLoader.h
remove CXX_WORKING_NAMESPACES
[lyx.git] / src / FontLoader.h
index 853e2e44e9618b798797c25daee020e50919bb0b..fce75a74b198d151d6e69baf0f6476aa6582936a 100644 (file)
@@ -4,27 +4,30 @@
  * 
  *           LyX, The Document Processor
  *      
- *           Copyright (C) 1997 Asger Alstrup
- *                     and the LyX Team.
+ *           Copyright 1997 Asger Alstrup
+ *          and the LyX Team.
  *
- *======================================================*/
+ * ====================================================== */
 
-#ifndef _FONTLOADER_H_
-#define _FONTLOADER_H_ 
+#ifndef FONTLOADER_H_
+#define FONTLOADER_H_ 
 
 #ifdef __GNUG__
 #pragma interface
 #endif
 
+
 #include FORMS_H_LOCATION
 #include "lyxfont.h"
-class LString;
+#include "LString.h"
+
 class FontInfo;
 
-/** This class takes care of loading fonts. It uses FontInfo to make intelligent
-guesses about matching font size, and it tries different tags itself in order
-to match the font loading demands.  Later, I plan to extend this with support 
-for T1Lib, probably via a new class building on this. (Asger) */
+/** This class takes care of loading fonts. It uses FontInfo to make 
+intelligent guesses about matching font size, and it tries different tags 
+itself in order to match the font loading demands.  Later, I plan to extend 
+this with support for T1Lib, probably via a new class building on this. 
+(Asger) */
 class FontLoader {
 public:
        ///
@@ -37,19 +40,18 @@ 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);
+                       return doLoad(family, series, shape, size);
        };
 private:
        /// Array of font structs
-       XFontStruct* fontstruct[4][2][4][10];
+       XFontStruct * fontstruct[4][2][4][10];
 
        /// Array of font infos
        FontInfo * fontinfo[4][2][4];
@@ -66,9 +68,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