summaryrefslogtreecommitdiff
path: root/src/Font.cc
diff options
context:
space:
mode:
authorScott Moynes <smoynes@nexus.carleton.ca>2002-10-01 01:59:09 +0000
committerScott Moynes <smoynes@nexus.carleton.ca>2002-10-01 01:59:09 +0000
commit72a2e98738d87b89620bafd15141690aa4be8fab (patch)
tree840e499622440035f074c0ab80ea00f3fb8a1327 /src/Font.cc
parent783fac59c994930139c1ee8162b9150e41dc8307 (diff)
merged with 2_1-merged-to-HEAD-2002-09-30
Diffstat (limited to 'src/Font.cc')
-rw-r--r--src/Font.cc30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/Font.cc b/src/Font.cc
index 68114a98..fd7a0fbe 100644
--- a/src/Font.cc
+++ b/src/Font.cc
@@ -270,9 +270,13 @@ void BFont::drawString(Drawable d, int x, int y, const BColor &color,
c.color.alpha = 0x40 | 0x40 << 8; // transparent shadow
c.pixel = BlackPixel(_display, _screen->getScreenNumber());
-
- XftDrawStringUtf8(draw, &c, _xftfont, x + 1, _xftfont->ascent + y + 1,
- (XftChar8 *) string.c_str(), string.size());
+#ifdef XFT_UTF8
+ XftDrawStringUtf8(
+#else
+ XftDrawString8(
+#endif
+ draw, &c, _xftfont, x + 1, _xftfont->ascent + y + 1,
+ (XftChar8 *) string.c_str(), string.size());
}
XftColor c;
@@ -282,8 +286,13 @@ void BFont::drawString(Drawable d, int x, int y, const BColor &color,
c.pixel = color.pixel();
c.color.alpha = 0xff | 0xff << 8; // no transparency in BColor yet
- XftDrawStringUtf8(draw, &c, _xftfont, x, _xftfont->ascent + y,
- (XftChar8 *) string.c_str(), string.size());
+#ifdef XFT_UTF8
+ XftDrawStringUtf8(
+#else
+ XftDrawString8(
+#endif
+ draw, &c, _xftfont, x, _xftfont->ascent + y,
+ (XftChar8 *) string.c_str(), string.size());
XftDrawDestroy(draw);
return;
@@ -309,8 +318,15 @@ unsigned int BFont::measureString(const string &string) const {
#ifdef XFT
if (_xftfont) {
XGlyphInfo info;
- XftTextExtentsUtf8(_display, _xftfont, (XftChar8 *) string.c_str(),
- string.size(), &info);
+
+#ifdef XFT_UTF8
+ XftTextExtentsUtf8(
+#else
+ XftTextExtents8(
+#endif
+ _display, _xftfont, (XftChar8 *) string.c_str(),
+ string.size(), &info);
+
return info.xOff + (_shadow ? 1 : 0);
}
#endif // XFT