- BFont(Display *d, BScreen *screen, const std::string &family, int size,
- bool bold, bool italic, bool shadow, unsigned char offset,
- unsigned char tint, bool antialias = True);
- virtual ~BFont(void);
-
- inline bool valid(void) const { return _valid; }
-
- inline std::string family(void) const { assert(_valid); return _family; }
- inline int size(void) const { assert(_valid); return _size; }
- inline bool bold(void) const { assert(_valid); return _bold; }
- inline bool italic(void) const { assert(_valid); return _italic; }
-
- unsigned int height(void) const;
- unsigned int maxCharWidth(void) const;
-
- unsigned int measureString(const std::string &string) const;
-
- void drawString(Drawable d, int x, int y, const BColor &color,
- const std::string &string) const;
+ Font(int screen_num, const std::string &fontstring, bool shadow,
+ unsigned char offset, unsigned char tint);
+ virtual ~Font();
+
+ 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;