]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: font.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
5 | // Id: $Id$ | |
6 | // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem | |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | ||
11 | #ifndef __GTKFONTH__ | |
12 | #define __GTKFONTH__ | |
13 | ||
14 | #ifdef __GNUG__ | |
15 | #pragma interface | |
16 | #endif | |
17 | ||
18 | #include "wx/defs.h" | |
19 | #include "wx/object.h" | |
20 | #include "wx/string.h" | |
21 | #include "wx/hash.h" | |
22 | #include "wx/gdiobj.h" | |
23 | ||
24 | //----------------------------------------------------------------------------- | |
25 | // classes | |
26 | //----------------------------------------------------------------------------- | |
27 | ||
28 | class wxDC; | |
29 | class wxPaintDC; | |
30 | class wxWindow; | |
31 | ||
32 | class wxFont; | |
33 | class wxFontNameDirectory; | |
34 | ||
35 | //----------------------------------------------------------------------------- | |
36 | // global variables | |
37 | //----------------------------------------------------------------------------- | |
38 | ||
39 | //extern wxFontNameDirectory *wxTheFontNameDirectory; // defined below | |
40 | ||
41 | //----------------------------------------------------------------------------- | |
42 | // wxFont | |
43 | //----------------------------------------------------------------------------- | |
44 | ||
45 | class wxFont: public wxGDIObject | |
46 | { | |
47 | DECLARE_DYNAMIC_CLASS(wxFont) | |
48 | ||
49 | public: | |
50 | wxFont(); | |
51 | wxFont( int PointSize, int FontIdOrFamily, int Style, int Weight, | |
52 | bool underlined = FALSE, const char *Face = ( const char *) NULL ); | |
53 | wxFont( int PointSize, const char *Face, int Family, | |
54 | int Style, int Weight, bool underlined = FALSE ); | |
55 | wxFont( const wxFont& font ); | |
56 | ~wxFont(); | |
57 | wxFont& operator = ( const wxFont& font ); | |
58 | bool operator == ( const wxFont& font ); | |
59 | bool operator != ( const wxFont& font ); | |
60 | bool Ok() const; | |
61 | ||
62 | int GetPointSize() const; | |
63 | wxString GetFaceName() const; | |
64 | int GetFamily() const; | |
65 | wxString GetFamilyString() const; | |
66 | int GetFontId() const; | |
67 | wxString GetFaceString() const; | |
68 | int GetStyle() const; | |
69 | wxString GetStyleString() const; | |
70 | int GetWeight() const; | |
71 | wxString GetWeightString() const; | |
72 | bool GetUnderlined() const; | |
73 | ||
74 | wxFont( char *xFontName ); | |
75 | ||
76 | // implementation | |
77 | ||
78 | GdkFont* GetInternalFont(float scale = 1.0) const; | |
79 | ||
80 | // no data :-) | |
81 | }; | |
82 | ||
83 | //----------------------------------------------------------------------------- | |
84 | // wxFontDirectory | |
85 | //----------------------------------------------------------------------------- | |
86 | ||
87 | class wxFontNameDirectory: public wxObject | |
88 | { | |
89 | DECLARE_DYNAMIC_CLASS(wxFontNameDirectory) | |
90 | ||
91 | public: | |
92 | wxFontNameDirectory(); | |
93 | ~wxFontNameDirectory(); | |
94 | ||
95 | void Initialize(); | |
96 | void Initialize(int fontid, int family, const char *name); | |
97 | ||
98 | int FindOrCreateFontId(const char *name, int family); | |
99 | char* GetAFMName(int fontid, int weight, int style); | |
100 | int GetFamily(int fontid); | |
101 | int GetFontId(const char *name); | |
102 | char* GetFontName(int fontid); | |
103 | int GetNewFontId(); | |
104 | char* GetPostScriptName(int fontid, int weight, int style); | |
105 | char* GetScreenName(int fontid, int weight, int style); | |
106 | ||
107 | class wxHashTable *table; | |
108 | int nextFontId; | |
109 | }; | |
110 | ||
111 | extern wxFontNameDirectory *wxTheFontNameDirectory; | |
112 | ||
113 | #endif // __GTKFONTH__ |