4 * Copyright 1997 the LyX Team
5 * Read the file COPYING
7 * \author John Levon <moz@compsoc.man.ac.uk>
18 #include <boost/smart_ptr.hpp>
22 #include "font_loader.h"
26 #include <qfontmetrics.h>
29 * Qt font loader for LyX. Matches LyXFonts against
30 * actual QFont instances, and also caches metrics.
36 virtual ~qfont_loader();
38 /// update fonts after zoom, dpi, font names, or norm change
39 virtual void update();
41 /// do we have anything matching?
42 virtual bool available(LyXFont const & f);
44 /// get the QFont for this LyXFont
45 QFont const & get(LyXFont const & f) {
46 return getfontinfo(f)->font;
49 /// get the QFont metrics for this LyXFont
50 QFontMetrics const & metrics(LyXFont const & f) {
51 return getfontinfo(f)->metrics;
55 /// hold info about a particular font
57 font_info(LyXFont const & f);
61 /// metrics on the font
65 /// get font info (font + metrics) for the given LyX font. Does not fail.
66 font_info const * getfontinfo(LyXFont const & f);
69 boost::scoped_ptr<font_info> fontinfo_[LyXFont::NUM_FAMILIES][2][4][10];
72 extern qfont_loader fontloader;
74 #endif // QFONT_LOADER_H