]> git.lyx.org Git - lyx.git/blob - src/font.h
Just some changes to be able to change TabularFeatures with the Table menu
[lyx.git] / src / font.h
1 // -*- C++ -*-
2 #ifndef FONT_H
3 #define FONT_H
4
5 #include <X11/Xlib.h>
6
7 #include "LString.h"
8
9 class LyXFont;
10
11 //namespace lyx {
12 //namespace font {
13
14 struct lyxfont {
15
16         static
17         int maxAscent(LyXFont const & f);
18
19         static
20         int maxDescent(LyXFont const & f);
21
22         static
23         int ascent(char c, LyXFont const & f);
24
25         static
26         int descent(char c, LyXFont const & f);
27
28         static
29         int lbearing(char c, LyXFont const & f);
30
31         static
32         int rbearing(char c, LyXFont const & f);
33
34         static
35         int width(char c, LyXFont const & f);
36
37         static
38         int width(char const * s, int n, LyXFont const & f);
39
40         static
41         int width(string const & s, LyXFont const & f) {
42                 if (s.empty()) return 0;
43                 return width(s.c_str(), s.length(), f);
44         }
45
46         static
47         int width(char const * s, LyXFont const & f) {
48                 return width(s, strlen(s), f);
49         }
50
51         static
52         int signedWidth(string const & s, LyXFont const & f);
53
54         static
55         int XTextWidth(LyXFont const & f, char * str, int count);
56
57         static
58         void XSetFont(Display * display, GC gc, LyXFont const & f);
59 };
60
61 //} // end of namespace font
62
63 // import into namespace lyx
64 //using font::maxAscent;
65 //using font::maxDescent;
66 //using font::ascent;
67 //using font::descent;
68 //using font::lbearing;
69 //using font::rbearing;
70 //using font::width;
71 //using font::signedWidth;
72 //using font::XTextWidth;
73 //using font::XSetFont;
74
75 //} // end of namespace lyx
76
77 #endif