* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-2000 The LyX Team.
+ * Copyright 1995-2001 The LyX Team.
*
* ====================================================== */
} else {
// emulate smallcaps since X doesn't support this
unsigned int result = 0;
- static XChar2b c = {0, 0};
+ static XChar2b c;
LyXFont smallfont(f);
smallfont.decSize().decSize().setShape(LyXFont::UP_SHAPE);
for (int i = 0; i < n; ++i) {
result += ::XTextWidth16(getXFontstruct(smallfont), &c, 1);
} else {
result += ::XTextWidth16(getXFontstruct(f), &s[i], 1);
- }
+ }
}
return result;
}
::XSetFont(display, gc, getFontID(f));
}
+
+void lyxfont::rectText(string const & str, LyXFont const & font,
+ int & width, int & ascent, int & descent)
+{
+ static int const d = 2;
+ width = lyxfont::width(str, font) + d * 2 + 2;
+ ascent = lyxfont::maxAscent(font) + d;
+ descent = lyxfont::maxDescent(font) + d;
+}
+
+
+
+void lyxfont::buttonText(string const & str, LyXFont const & font,
+ int & width, int & ascent, int & descent)
+{
+ static int const d = 3;
+
+ width = lyxfont::width(str, font) + d * 2 + 2;
+ ascent = lyxfont::maxAscent(font) + d;
+ descent = lyxfont::maxDescent(font) + d;
+}
+
+
//} // end of namespace font
//} // end of namespace lyx