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
17 #include <X11/Xft/Xft.h>
30 /// Update fonts after zoom, dpi, font names, or norm change
33 bool available(LyXFont const & f);
36 XftFont * load(LyXFont::FONT_FAMILY family,
37 LyXFont::FONT_SERIES series,
38 LyXFont::FONT_SHAPE shape,
39 LyXFont::FONT_SIZE size)
41 if (fonts_[family][series][shape][size])
42 return fonts_[family][series][shape][size];
44 return doLoad(family, series, shape, size);
46 bool isSpecial(LyXFont const & f)
49 case LyXFont::CMR_FAMILY:
50 case LyXFont::EUFRAK_FAMILY:
55 return f.isSymbolFont();
59 XftFont * fonts_[LyXFont::NUM_FAMILIES][2][4][10];
60 XftPattern * getFontPattern(LyXFont::FONT_FAMILY family,
61 LyXFont::FONT_SERIES series,
62 LyXFont::FONT_SHAPE shape,
63 LyXFont::FONT_SIZE size);
64 string familyString(LyXFont::FONT_FAMILY family);
65 /// Reset font handler
71 /** Does the actual loading of a font. Updates fontstruct. */
72 XftFont * doLoad(LyXFont::FONT_FAMILY family,
73 LyXFont::FONT_SERIES series,
74 LyXFont::FONT_SHAPE shape,
75 LyXFont::FONT_SIZE size);
79 extern xftFontLoader fontLoader;