]>
Dogcows Code - chaz/openbox/blob - otk/font.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
9 #define _XFT_NO_COMPAT_ // no Xft 1 API
10 #include <X11/Xft/Xft.h>
24 static std::string _fallback_font
;
25 static bool _xft_init
;
28 // the fallback is only used for X fonts, not for Xft fonts, since it is
29 // assumed that X fonts will be the fallback from Xft.
30 inline static std::string
fallbackFont(void) { return _fallback_font
; }
31 inline static void setFallbackFont(const std::string
&f
)
32 { _fallback_font
= f
; }
40 std::string _fontstring
;
43 unsigned char _offset
;
48 bool createXftFont(void);
52 Font(int screen_num
, const std::string
&fontstring
, bool shadow
,
53 unsigned char offset
, unsigned char tint
);
56 inline const std::string
&fontstring() const { return _fontstring
; }
58 unsigned int height() const;
59 unsigned int maxCharWidth() const;
61 unsigned int measureString(const ustring
&string
) const;
63 //! Draws a string into an XftDraw object
65 Be Warned: If you use an XftDraw object and a color, or a font from
66 different screens, you WILL have unpredictable results! :)
68 void drawString(XftDraw
*d
, int x
, int y
, const Color
&color
,
69 const ustring
&string
) const;
This page took 0.034209 seconds and 4 git commands to generate.