3 * \file xftFontLoader.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef XFT_FONT_LOADER_H
13 #define XFT_FONT_LOADER_H
15 #include "frontends/FontLoader.h"
20 #include <X11/Xft/Xft.h>
25 class xftFontLoader: public lyx::frontend::FontLoader {
31 virtual ~xftFontLoader();
33 /// Update fonts after zoom, dpi, font names, or norm change
34 virtual void update();
36 virtual bool available(LyXFont const & f);
39 XftFont * load(LyXFont::FONT_FAMILY family,
40 LyXFont::FONT_SERIES series,
41 LyXFont::FONT_SHAPE shape,
42 LyXFont::FONT_SIZE size)
44 if (fonts_[family][series][shape][size])
45 return fonts_[family][series][shape][size];
47 return doLoad(family, series, shape, size);
50 bool isSpecial(LyXFont const & f)
53 case LyXFont::CMR_FAMILY:
54 case LyXFont::EUFRAK_FAMILY:
59 return f.isSymbolFont();
63 XftFont * fonts_[LyXFont::NUM_FAMILIES][2][4][10];
64 XftPattern * getFontPattern(LyXFont::FONT_FAMILY family,
65 LyXFont::FONT_SERIES series,
66 LyXFont::FONT_SHAPE shape,
67 LyXFont::FONT_SIZE size);
68 std::string familyString(LyXFont::FONT_FAMILY family);
69 /// Reset font handler
75 /** Does the actual loading of a font. Updates fontstruct. */
76 XftFont * doLoad(LyXFont::FONT_FAMILY family,
77 LyXFont::FONT_SERIES series,
78 LyXFont::FONT_SHAPE shape,
79 LyXFont::FONT_SIZE size);
83 extern xftFontLoader fontLoader;