2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2001 The LyX Team.
10 * ====================================================== */
31 int maxAscent(LyXFont const & f);
34 int maxDescent(LyXFont const & f);
37 int ascent(char c, LyXFont const & f);
40 int descent(char c, LyXFont const & f);
43 int lbearing(char c, LyXFont const & f);
46 int rbearing(char c, LyXFont const & f);
49 int width(char c, LyXFont const & f) {
50 return width(&c, 1, f);
54 int width(char const * s, size_t n, LyXFont const & f);
57 int width(string const & s, LyXFont const & f) {
58 if (s.empty()) return 0;
59 return width(s.data(), s.length(), f);
63 //int width(char const * s, LyXFont const & f) {
64 // return width(s, strlen(s), f);
68 int signedWidth(string const & s, LyXFont const & f);
71 int XTextWidth(LyXFont const & f, char const * str, int count);
74 int width(XChar2b const * s, int n, LyXFont const & f);
77 int XTextWidth16(LyXFont const & f, XChar2b const * str, int count);
80 void XSetFont(Display * display, GC gc, LyXFont const & f);
81 // A couple of more high-level metrics
84 void rectText(string const & str, LyXFont const & font,
85 int & width, int & ascent, int & descent);
88 void buttonText(string const & str, LyXFont const & font,
89 int & width, int & ascent, int & descent);
92 //} // end of namespace font
94 // import into namespace lyx
95 //using font::maxAscent;
96 //using font::maxDescent;
98 //using font::descent;
99 //using font::lbearing;
100 //using font::rbearing;
102 //using font::signedWidth;
103 //using font::XTextWidth;
104 //using font::XSetFont;
106 //} // end of namespace lyx