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
18 #include <X11/Xft/Xft.h>
31 /// Update fonts after zoom, dpi, font names, or norm change
34 bool available(LyXFont const & f);
37 XftFont * load(LyXFont::FONT_FAMILY family,
38 LyXFont::FONT_SERIES series,
39 LyXFont::FONT_SHAPE shape,
40 LyXFont::FONT_SIZE size)
42 if (fonts_[family][series][shape][size])
43 return fonts_[family][series][shape][size];
45 return doLoad(family, series, shape, size);
48 bool isSpecial(LyXFont const & f)
51 case LyXFont::CMR_FAMILY:
52 case LyXFont::EUFRAK_FAMILY:
57 return f.isSymbolFont();
61 XftFont * fonts_[LyXFont::NUM_FAMILIES][2][4][10];
62 XftPattern * getFontPattern(LyXFont::FONT_FAMILY family,
63 LyXFont::FONT_SERIES series,
64 LyXFont::FONT_SHAPE shape,
65 LyXFont::FONT_SIZE size);
66 std::string familyString(LyXFont::FONT_FAMILY family);
67 /// Reset font handler
73 /** Does the actual loading of a font. Updates fontstruct. */
74 XftFont * doLoad(LyXFont::FONT_FAMILY family,
75 LyXFont::FONT_SERIES series,
76 LyXFont::FONT_SHAPE shape,
77 LyXFont::FONT_SIZE size);
81 extern xftFontLoader fontLoader;