default to drawing as utf8
This commit is contained in:
parent
a4d4aaec3f
commit
805a5dddce
1 changed files with 3 additions and 14 deletions
17
otk/font.hh
17
otk/font.hh
|
@ -2,8 +2,6 @@
|
||||||
#ifndef __font_hh
|
#ifndef __font_hh
|
||||||
#define __font_hh
|
#define __font_hh
|
||||||
|
|
||||||
#include "userstring.hh"
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#define _XFT_NO_COMPAT_ // no Xft 1 API
|
#define _XFT_NO_COMPAT_ // no Xft 1 API
|
||||||
|
@ -11,7 +9,6 @@ extern "C" {
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace otk {
|
namespace otk {
|
||||||
|
@ -60,24 +57,16 @@ public:
|
||||||
unsigned int height() const;
|
unsigned int height() const;
|
||||||
unsigned int maxCharWidth() const;
|
unsigned int maxCharWidth() const;
|
||||||
|
|
||||||
//! Measures the length of a string
|
unsigned int measureString(const std::string &string,
|
||||||
/*!
|
bool utf8 = true) const;
|
||||||
@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
|
//! Draws a string into an XftDraw object
|
||||||
/*!
|
/*!
|
||||||
Be Warned: If you use an XftDraw object and a color, or a font from
|
Be Warned: If you use an XftDraw object and a color, or a font from
|
||||||
different screens, you WILL have unpredictable results! :)
|
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,
|
void drawString(XftDraw *d, int x, int y, const Color &color,
|
||||||
const userstring &string) const;
|
const std::string &string, bool utf8 = true) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue