aboutsummaryrefslogtreecommitdiff
path: root/src/XFontImp.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/XFontImp.hh')
-rw-r--r--src/XFontImp.hh38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/XFontImp.hh b/src/XFontImp.hh
index 8ea7af1..b293fdd 100644
--- a/src/XFontImp.hh
+++ b/src/XFontImp.hh
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: XFontImp.hh,v 1.3 2002/10/19 13:58:47 fluxgen Exp $ 22// $Id: XFontImp.hh,v 1.4 2002/11/25 14:07:21 fluxgen Exp $
23 23
24#ifndef XFONTIMP_HH 24#ifndef XFONTIMP_HH
25#define XFONTIMP_HH 25#define XFONTIMP_HH
@@ -33,12 +33,46 @@ public:
33 bool load(const std::string &filename); 33 bool load(const std::string &filename);
34 unsigned int textWidth(const char * const text, unsigned int size) const; 34 unsigned int textWidth(const char * const text, unsigned int size) const;
35 unsigned int height() const; 35 unsigned int height() const;
36 int ascent() const { return m_fontstruct ? m_fontstruct->ascent : 0; } 36 float angle() const { return m_angle; }
37 int ascent() const;
37 int descent() const { return m_fontstruct ? m_fontstruct->descent : 0; } 38 int descent() const { return m_fontstruct ? m_fontstruct->descent : 0; }
38 void drawText(Drawable w, int screen, GC gc, const char *text, size_t len, int x, int y) const; 39 void drawText(Drawable w, int screen, GC gc, const char *text, size_t len, int x, int y) const;
39 bool loaded() const { return m_fontstruct != 0; } 40 bool loaded() const { return m_fontstruct != 0; }
41 void rotate(float angle);
40private: 42private:
43 void freeRotFont();
44 void drawRotText(Drawable w, int screen, GC gc, const char *text, size_t len, int x, int y) const;
45 unsigned int rotTextWidth(const char * const text, unsigned int size) const;
46 struct BitmapStruct {
47 int bit_w;
48 int bit_h;
49
50 Pixmap bm;
51 };
52
53 struct XRotCharStruct {
54 int ascent;
55 int descent;
56 int lbearing;
57 int rbearing;
58 int width;
59
60 BitmapStruct glyph;
61 };
62
63 struct XRotFontStruct {
64 int dir;
65 int height;
66 int max_ascent;
67 int max_descent;
68 int max_char;
69 int min_char;
70
71 XRotCharStruct per_char[95];
72 };
73 XRotFontStruct *m_rotfont;
41 XFontStruct *m_fontstruct; 74 XFontStruct *m_fontstruct;
75 float m_angle;
42}; 76};
43 77
44#endif // XFONTIMP_HH 78#endif // XFONTIMP_HH