aboutsummaryrefslogtreecommitdiff
path: root/src/Font.hh
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-11-26 15:57:11 (GMT)
committerfluxgen <fluxgen>2002-11-26 15:57:11 (GMT)
commitb5acf3a78f51e9fb1503f82e2235d98694328a67 (patch)
treea003883b85909bc1e1d20d30e1e2d98f8df6e470 /src/Font.hh
parentfe2e6b32e7fd285a32d5210220e18da9abb7732f (diff)
downloadfluxbox_pavel-b5acf3a78f51e9fb1503f82e2235d98694328a67.zip
fluxbox_pavel-b5acf3a78f51e9fb1503f82e2235d98694328a67.tar.bz2
moved to FbTk
Diffstat (limited to 'src/Font.hh')
-rw-r--r--src/Font.hh84
1 files changed, 0 insertions, 84 deletions
diff --git a/src/Font.hh b/src/Font.hh
deleted file mode 100644
index a1fb62d..0000000
--- a/src/Font.hh
+++ /dev/null
@@ -1,84 +0,0 @@
1// Font.cc
2// Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org)
3//
4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"),
6// to deal in the Software without restriction, including without limitation
7// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8// and/or sell copies of the Software, and to permit persons to whom the
9// Software is furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE.
21
22//$Id: Font.hh,v 1.9 2002/11/25 14:07:21 fluxgen Exp $
23
24#ifndef FBTK_FONT_HH
25#define FBTK_FONT_HH
26
27#include <X11/Xlib.h>
28#include <X11/Xresource.h>
29
30#include <string>
31#include <memory>
32
33namespace FbTk {
34
35class FontImp;
36
37/**
38 Handles the client to fontimp bridge.
39*/
40class Font {
41public:
42 Font(const char *name=0, bool antialias = false);
43 virtual ~Font();
44 /**
45 Load a font
46 @return true on success, else false and it'll fall back on the last
47 loaded font
48 */
49 bool load(const char *name);
50
51 /// @return true if multibyte is enabled, else false
52 static bool multibyte() { return m_multibyte; }
53 /// @return true if utf-8 mode is enabled, else false
54 static bool utf8() { return m_utf8mode; }
55 void setAntialias(bool flag);
56 /**
57 @param text text to check size
58 @param size length of text in bytes
59 @return size of text in pixels
60 */
61 unsigned int textWidth(const char * const text, unsigned int size) const;
62 unsigned int height() const;
63 int ascent() const;
64 int descent() const;
65 /**
66 Rotate font in any angle (currently only 90 degrees supported and just XFont implementation)
67 */
68 void rotate(float angle);
69 void drawText(Drawable w, int screen, GC gc, const char *text, size_t len, int x, int y) const;
70 bool isAntialias() const { return m_antialias; }
71 bool isRotated() const { return m_rotated; }
72private:
73
74 std::auto_ptr<FontImp> m_fontimp;
75 std::string m_fontstr;
76 static bool m_multibyte;
77 static bool m_utf8mode;
78 bool m_antialias;
79 bool m_rotated; ///< wheter we're rotated or not
80};
81
82}; //end namespace FbTk
83
84#endif //FBTK_FONT_HH