]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiFontLoader.h
1d09b6d616cad0af957c37786be2e9369cbd0df6
[lyx.git] / src / frontends / qt4 / GuiFontLoader.h
1 // -*- C++ -*-
2 /**
3  * \file GuiFontLoader.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef GUI_FONTLOADER_H
13 #define GUI_FONTLOADER_H
14
15 #include "GuiFontMetrics.h"
16
17 #include <QFont>
18
19 namespace lyx {
20 namespace frontend {
21
22 /**
23  * Qt font loader for LyX. Matches Fonts against
24  * actual QFont instances, and also caches metrics.
25  */
26 class GuiFontInfo
27 {
28 public:
29         GuiFontInfo(FontInfo const & f);
30
31         /// The font instance
32         QFont font;
33         /// Metrics on the font
34         GuiFontMetrics metrics;
35 };
36
37
38 // Load font
39 GuiFontInfo const & getFontInfo(FontInfo const & f);
40 /// Get the QFont for this FontInfo
41 QFont const & getFont(FontInfo const & f);
42
43 } // namespace frontend
44 } // namespace lyx
45
46 #endif // GUI_FONTLOADER_H