]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/xftFontMetrics.h
fontloader for gtk, probably not efficient
[lyx.git] / src / frontends / gtk / xftFontMetrics.h
1 // -*- C++ -*-
2 /**
3  * \file xftFontMetrics.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Abdelrazak Younes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef XFT_FONT_METRICS_H
13 #define XFT_FONT_METRICS_H
14
15 #include "frontends/FontMetrics.h"
16
17 #include <gtkmm.h>
18 #include <X11/Xft/Xft.h>
19
20 class font_metrics: public lyx::frontend::FontMetrics
21 {
22 public:
23
24         font_metrics(XftFont * f, XftFont * scf);
25
26         virtual ~font_metrics() {}
27
28         virtual int maxAscent() const;
29         virtual int maxDescent() const;
30         virtual int ascent(lyx::char_type c) const;
31         int descent(lyx::char_type c) const;
32         virtual int lbearing(lyx::char_type c) const;
33         virtual int rbearing(lyx::char_type c) const;
34         virtual int width(lyx::char_type const * s, size_t n) const;
35         virtual int signedWidth(lyx::docstring const & s) const;
36         virtual void rectText(lyx::docstring const & str,
37                 int & width,
38                 int & ascent,
39                 int & descent) const;
40         virtual void buttonText(lyx::docstring const & str,
41                 int & width,
42                 int & ascent,
43                 int & descent) const;
44 private:
45         XftFont * font;
46         XftFont * fontS;
47 };
48 #endif // XFT_FONT_METRICS_H