4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Asger Alstrup
9 * Full author contact details are available in file CREDITS.
23 /** This class takes care of loading fonts. It uses FontInfo to make
24 intelligent guesses about matching font size, and it tries different tags
25 itself in order to match the font loading demands. Later, I plan to extend
26 this with support for T1Lib, probably via a new class building on this.
36 /// Update fonts after zoom, dpi, font names, or norm change
40 XFontStruct * load(LyXFont::FONT_FAMILY family,
41 LyXFont::FONT_SERIES series,
42 LyXFont::FONT_SHAPE shape,
43 LyXFont::FONT_SIZE size) {
44 if (fontstruct[family][series][shape][size] != 0)
45 return fontstruct[family][series][shape][size];
47 return doLoad(family, series, shape, size);
49 /// Do we have anything matching?
50 bool available(LyXFont const & f);
53 /// Array of font structs
54 XFontStruct * fontstruct[LyXFont::NUM_FAMILIES][2][4][10];
56 /// Array of font infos
57 FontInfo * fontinfo[LyXFont::NUM_FAMILIES][2][4];
59 /// Reset font handler
66 void getFontinfo(LyXFont::FONT_FAMILY family,
67 LyXFont::FONT_SERIES series,
68 LyXFont::FONT_SHAPE shape);
70 /** Does the actual loading of a font. Updates fontstruct. */
71 XFontStruct * doLoad(LyXFont::FONT_FAMILY family,
72 LyXFont::FONT_SERIES series,
73 LyXFont::FONT_SHAPE shape,
74 LyXFont::FONT_SIZE size);
78 extern xfont_loader fontloader;
80 } // namespace frontend