X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Ffont.hh;h=53e48c4ebad194546cdd99e1716f98b7f4966a36;hb=a86421d7d87dd1336101a7df62878d213020f38b;hp=8e736d8eb746c3958c3b24ddd41ead0c4ec2f92f;hpb=74061b4e2d33d7e2101c4edda26cfc2a1294f32b;p=chaz%2Fopenbox diff --git a/otk/font.hh b/otk/font.hh index 8e736d8e..53e48c4e 100644 --- a/otk/font.hh +++ b/otk/font.hh @@ -2,7 +2,8 @@ #ifndef __font_hh #define __font_hh -#include "userstring.hh" +#include "ustring.hh" +#include "truerendercontrol.hh" extern "C" { #include @@ -10,33 +11,20 @@ extern "C" { #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; @@ -57,27 +45,14 @@ public: inline const std::string &fontstring() const { return _fontstring; } - unsigned int height() const; - unsigned int maxCharWidth() const; - - //! Measures the length of a string - /*! - @param string The string to measure, it should be UTF8 encoded. - */ - unsigned int measureString(const userstring &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! :) - @param d The drawable to render into. - @param x The X offset onto the drawable at which to start drawing. - @param x The Y offset onto the drawable at which to start drawing. - @param color The color to use for drawing the text. - @param string The string to draw, it should be UTF8 encoded. - */ - void drawString(XftDraw *d, int x, int y, const Color &color, - const userstring &string) const; + int height() const; + int maxCharWidth() const; + + int measureString(const ustring &string) const; + + // The RenderControl classes use the internal data to render the fonts, but + // noone else needs it, so its private. + friend class RenderControl; }; }