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 * ====================================================== */
25 namespace font_metrics {
31 int maxAscent(LyXFont const & f);
33 int maxDescent(LyXFont const & f);
35 int ascent(char c, LyXFont const & f);
37 int descent(char c, LyXFont const & f);
39 int lbearing(char c, LyXFont const & f);
41 int rbearing(char c, LyXFont const & f);
43 int width(char const * s, size_t n, LyXFont const & f);
45 int width(char c, LyXFont const & f);
47 int width(string const & s, LyXFont const & f);
50 //int width(char const * s, LyXFont const & f) {
51 // return width(s, strlen(s), f);
54 int signedWidth(string const & s, LyXFont const & f);
56 int XTextWidth(LyXFont const & f, char const * str, int count);
58 int width(XChar2b const * s, int n, LyXFont const & f);
60 int XTextWidth16(LyXFont const & f, XChar2b const * str, int count);
62 void XSetFont(Display * display, GC gc, LyXFont const & f);
63 // A couple of more high-level metrics
65 void rectText(string const & str, LyXFont const & font,
66 int & width, int & ascent, int & descent);
68 void buttonText(string const & str, LyXFont const & font,
69 int & width, int & ascent, int & descent);
73 //} // end of namespace font
75 // import into namespace lyx
76 //using font::maxAscent;
77 //using font::maxDescent;
79 //using font::descent;
80 //using font::lbearing;
81 //using font::rbearing;
83 //using font::signedWidth;
84 //using font::XTextWidth;
85 //using font::XSetFont;
87 //} // end of namespace lyx