X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=otk%2Ffont.cc;h=a38946f02ad4efc3efccf72e5ea71c92de714154;hb=5b52a8f5610d3cc0a39ecb6b341e69596d892099;hp=6fbdb0957f1d7dddf9622028aeb8afc2edde4e00;hpb=4947902d269213edee40f3f31f97721fa0dd3877;p=chaz%2Fopenbox diff --git a/otk/font.cc b/otk/font.cc index 6fbdb095..a38946f0 100644 --- a/otk/font.cc +++ b/otk/font.cc @@ -51,19 +51,20 @@ Font::Font(int screen_num, const std::string &fontstring, ::exit(3); } int version = XftGetVersion(); - printf(_("Using Xft %d.%d.%d.\n"), - version / 10000 % 100, version / 100 % 100, version % 100); + printf(_("Using Xft %d.%d.%d (Built against %d.%d.%d).\n"), + version / 10000 % 100, version / 100 % 100, version % 100, + XFT_MAJOR, XFT_MINOR, XFT_REVISION); _xft_init = true; } - if ((_xftfont = XftFontOpenName(Display::display, _screen_num, + if ((_xftfont = XftFontOpenName(**display, _screen_num, _fontstring.c_str()))) return; printf(_("Unable to load font: %s\n"), _fontstring.c_str()); printf(_("Trying fallback font: %s\n"), _fallback_font.c_str()); - if ((_xftfont = XftFontOpenName(Display::display, _screen_num, + if ((_xftfont = XftFontOpenName(**display, _screen_num, _fallback_font.c_str()))) return; @@ -77,7 +78,7 @@ Font::Font(int screen_num, const std::string &fontstring, Font::~Font(void) { if (_xftfont) - XftFontClose(Display::display, _xftfont); + XftFontClose(**display, _xftfont); } @@ -92,16 +93,16 @@ void Font::drawString(XftDraw *d, int x, int y, const Color &color, c.color.green = 0; c.color.blue = 0; c.color.alpha = _tint | _tint << 8; // transparent shadow - c.pixel = BlackPixel(Display::display, _screen_num); + c.pixel = BlackPixel(**display, _screen_num); if (string.utf8()) XftDrawStringUtf8(d, &c, _xftfont, x + _offset, _xftfont->ascent + y + _offset, - (FcChar8*)string.c_str(), string.size()); + (FcChar8*)string.c_str(), string.bytes()); else XftDrawString8(d, &c, _xftfont, x + _offset, _xftfont->ascent + y + _offset, - (FcChar8*)string.c_str(), string.size()); + (FcChar8*)string.c_str(), string.bytes()); } XftColor c; @@ -113,10 +114,10 @@ void Font::drawString(XftDraw *d, int x, int y, const Color &color, if (string.utf8()) XftDrawStringUtf8(d, &c, _xftfont, x, _xftfont->ascent + y, - (FcChar8*)string.c_str(), string.size()); + (FcChar8*)string.c_str(), string.bytes()); else XftDrawString8(d, &c, _xftfont, x, _xftfont->ascent + y, - (FcChar8*)string.c_str(), string.size()); + (FcChar8*)string.c_str(), string.bytes()); return; } @@ -127,11 +128,11 @@ unsigned int Font::measureString(const ustring &string) const XGlyphInfo info; if (string.utf8()) - XftTextExtentsUtf8(Display::display, _xftfont, - (FcChar8*)string.c_str(), string.size(), &info); + XftTextExtentsUtf8(**display, _xftfont, + (FcChar8*)string.c_str(), string.bytes(), &info); else - XftTextExtents8(Display::display, _xftfont, - (FcChar8*)string.c_str(), string.size(), &info); + XftTextExtents8(**display, _xftfont, + (FcChar8*)string.c_str(), string.bytes(), &info); return info.xOff + (_shadow ? _offset : 0); }