X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Ffont.hh;h=53e48c4ebad194546cdd99e1716f98b7f4966a36;hb=739c958ac58154f8b1896113701e1c7f580d4cde;hp=9091b9bcf857638ba9f3bbfb65147000fcfd7eac;hpb=8f8acc24933830d4f5784616b9b0c5896bde0b93;p=chaz%2Fopenbox diff --git a/otk/font.hh b/otk/font.hh index 9091b9bc..53e48c4e 100644 --- a/otk/font.hh +++ b/otk/font.hh @@ -2,38 +2,29 @@ #ifndef __font_hh #define __font_hh +#include "ustring.hh" +#include "truerendercontrol.hh" + extern "C" { #include #define _XFT_NO_COMPAT_ // no Xft 1 API #include } -#include -#include +#include namespace otk { class Color; +class Surface; class Font { /* * static members */ private: - static std::string _fallback_font; - static bool _xft_init; - -public: - // the fallback is only used for X fonts, not for Xft fonts, since it is - // assumed that X fonts will be the fallback from Xft. - inline static std::string fallbackFont(void) { return _fallback_font; } - inline static void setFallbackFont(const std::string &f) - { _fallback_font = f; } + static bool _xft_init; - /* - * instance members - */ -private: int _screen_num; std::string _fontstring; @@ -54,19 +45,14 @@ public: inline const std::string &fontstring() const { return _fontstring; } - unsigned int height() const; - unsigned int maxCharWidth() const; + int height() const; + int maxCharWidth() const; - unsigned int measureString(const std::string &string, - bool utf8 = false) const; + int measureString(const ustring &string) const; - //! Draws a string into an XftDraw object - /*! - Be Warned: If you use an XftDraw object and a color, or a font from - different screens, you WILL have unpredictable results! :) - */ - void drawString(XftDraw *d, int x, int y, const Color &color, - const std::string &string, bool utf8 = false) const; + // The RenderControl classes use the internal data to render the fonts, but + // noone else needs it, so its private. + friend class RenderControl; }; }