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
25 #include <qfontmetrics.h>
28 * Qt font loader for LyX. Matches LyXFonts against
29 * actual QFont instances, and also caches metrics.
37 /// update fonts after zoom, dpi, font names, or norm change
40 /// do we have anything matching?
41 bool available(LyXFont const & f);
43 /// get the QFont for this LyXFont
44 QFont const & get(LyXFont const & f);
46 /// get the QFont metrics for this LyXFont
47 QFontMetrics const & metrics(LyXFont const & f) {
48 return getfontinfo(f)->metrics;
51 /// return pixel width for the given unicode char
52 int charwidth(LyXFont const & f, Uchar val);
55 /// hold info about a particular font
57 font_info(LyXFont const & f);
61 /// metrics on the font
64 typedef std::map<Uchar, int> WidthCache;
65 /// cache of char widths
66 WidthCache widthcache;
69 /// get font info (font + metrics) for the given LyX font. Does not fail.
70 font_info * getfontinfo(LyXFont const & f);
73 font_info * fontinfo_[LyXFont::NUM_FAMILIES][2][4][10];
76 extern qfont_loader fontloader;
78 #endif // QFONT_LOADER_H