]>
Dogcows Code - chaz/openbox/blob - Font.hh
38c4b4f873946bf537619a7e4996f84c4872e52f
1 // -*- mode: C++; indent-tabs-mode: nil; -*-
2 // Font.hh for Blackbox - an X11 Window manager
3 // Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry <shaleh@debian.org>
4 // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
6 // Permission is hereby granted, free of charge, to any person obtaining a
7 // copy of this software and associated documentation files (the "Software"),
8 // to deal in the Software without restriction, including without limitation
9 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 // and/or sell copies of the Software, and to permit persons to whom the
11 // Software is furnished to do so, subject to the following conditions:
13 // The above copyright notice and this permission notice shall be included in
14 // all copies or substantial portions of the Software.
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 // DEALINGS IN THE SOFTWARE.
31 # include <X11/Xft/Xft.h>
50 // static bool _antialias;
51 static std::string _fallback_font
;
54 // inline static bool antialias(void) { return _antialias; }
55 // inline static void setAntialias(bool a) { _antialias = a; }
57 inline static std::string
fallbackFont(void) { return _fallback_font
; }
58 inline static void setFallbackFont(const std::string
&f
)
59 { _fallback_font
= f
; }
69 bool _simplename
; // true if not spec'd as a -*-* string
82 XFontSetExtents
*_fontset_extents
;
84 std::string
buildXlfdName(bool mb
) const;
86 bool init(const std::string
&xlfd
= "");
87 bool createFont(void);
88 bool parseFontString(const std::string
&xlfd
);
90 mutable BGCCache
*_cache
;
91 mutable BGCCacheItem
*_item
;
96 BFont(Display
*d
, BScreen
*screen
, const std::string
&family
, int size
,
97 bool bold
, bool italic
);
98 BFont(Display
*d
, BScreen
*screen
, const std::string
&xlfd
);
101 inline bool valid(void) const { return _valid
; }
103 inline std::string
name(void) const { assert(_valid
); return _name
; }
104 inline int size(void) const { assert(_valid
); return _size
/ 10; }
105 inline bool bold(void) const { assert(_valid
); return _bold
; }
106 inline bool italic(void) const { assert(_valid
); return _italic
; }
108 unsigned int height(void) const;
109 unsigned int maxCharWidth(void) const;
111 unsigned int measureString(const std::string
&string
) const;
113 void drawString(Drawable d
, int x
, int y
, const BColor
&color
,
114 const std::string
&string
) const;
This page took 0.038014 seconds and 3 git commands to generate.