summaryrefslogtreecommitdiff
path: root/otk/font.hh
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-01-12 21:17:26 +0000
committerDana Jansens <danakj@orodu.net>2003-01-12 21:17:26 +0000
commit74061b4e2d33d7e2101c4edda26cfc2a1294f32b (patch)
treec0bfe3b00472252f4cbf67c39bd82110f8a03175 /otk/font.hh
parentc03068ee3a2e981e31eeda583d10b9d572de92bd (diff)
use "userstring" for all user viewable strings
Diffstat (limited to 'otk/font.hh')
-rw-r--r--otk/font.hh17
1 files changed, 14 insertions, 3 deletions
diff --git a/otk/font.hh b/otk/font.hh
index 9091b9bc..8e736d8e 100644
--- a/otk/font.hh
+++ b/otk/font.hh
@@ -2,6 +2,8 @@
#ifndef __font_hh
#define __font_hh
+#include "userstring.hh"
+
extern "C" {
#include <X11/Xlib.h>
#define _XFT_NO_COMPAT_ // no Xft 1 API
@@ -9,6 +11,7 @@ extern "C" {
}
#include <assert.h>
+
#include <string>
namespace otk {
@@ -57,16 +60,24 @@ public:
unsigned int height() const;
unsigned int maxCharWidth() const;
- unsigned int measureString(const std::string &string,
- bool utf8 = false) 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 std::string &string, bool utf8 = false) const;
+ const userstring &string) const;
};
}