]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: font.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
58614078 | 5 | // Id: $Id$ |
c801d85f KB |
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 | ||
a3622daa | 39 | //extern wxFontNameDirectory *wxTheFontNameDirectory; // defined below |
c801d85f KB |
40 | |
41 | //----------------------------------------------------------------------------- | |
42 | // wxFont | |
43 | //----------------------------------------------------------------------------- | |
44 | ||
45 | class wxFont: public wxGDIObject | |
46 | { | |
47 | DECLARE_DYNAMIC_CLASS(wxFont) | |
48 | ||
49 | public: | |
50 | wxFont(void); | |
51 | wxFont( int PointSize, int FontIdOrFamily, int Style, int Weight, | |
c67daf87 | 52 | bool underlined = FALSE, const char *Face= ( const char *) NULL ); |
c801d85f KB |
53 | wxFont( int PointSize, const char *Face, int Family, int Style, int Weight, |
54 | bool underlined = FALSE ); | |
55 | wxFont( const wxFont& font ); | |
56 | wxFont( const wxFont* font ); | |
57 | ~wxFont(void); | |
58 | wxFont& operator = ( const wxFont& font ); | |
59 | bool operator == ( const wxFont& font ); | |
60 | bool operator != ( const wxFont& font ); | |
d84eb083 | 61 | bool Ok() const; |
c801d85f KB |
62 | |
63 | int GetPointSize(void) const; | |
64 | wxString GetFaceName(void) const; | |
65 | int GetFamily(void) const; | |
66 | wxString GetFamilyString(void) const; | |
67 | int GetFontId(void) const; | |
68 | wxString GetFaceString(void) const; | |
69 | int GetStyle(void) const; | |
70 | wxString GetStyleString(void) const; | |
71 | int GetWeight(void) const; | |
72 | wxString GetWeightString(void) const; | |
73 | bool GetUnderlined(void) const; | |
74 | ||
75 | wxFont( char *xFontName ); | |
868a2826 RR |
76 | |
77 | // implementation | |
c801d85f | 78 | |
c33c4050 | 79 | GdkFont* GetInternalFont(float scale = 1.0) const; |
c801d85f KB |
80 | |
81 | // no data :-) | |
82 | }; | |
83 | ||
84 | //----------------------------------------------------------------------------- | |
85 | // wxFontDirectory | |
86 | //----------------------------------------------------------------------------- | |
87 | ||
88 | class wxFontNameDirectory: public wxObject | |
89 | { | |
90 | DECLARE_DYNAMIC_CLASS(wxFontNameDirectory) | |
91 | ||
92 | public: | |
93 | wxFontNameDirectory(void); | |
94 | ~wxFontNameDirectory(); | |
95 | ||
96 | void Initialize(void); | |
97 | void Initialize(int fontid, int family, const char *name); | |
98 | ||
99 | int FindOrCreateFontId(const char *name, int family); | |
100 | char* GetAFMName(int fontid, int weight, int style); | |
101 | int GetFamily(int fontid); | |
102 | int GetFontId(const char *name); | |
103 | char* GetFontName(int fontid); | |
104 | int GetNewFontId(void); | |
105 | char* GetPostScriptName(int fontid, int weight, int style); | |
106 | char* GetScreenName(int fontid, int weight, int style); | |
107 | ||
108 | ||
109 | class wxHashTable *table; | |
110 | int nextFontId; | |
111 | }; | |
112 | ||
a3622daa | 113 | extern wxFontNameDirectory *wxTheFontNameDirectory; |
c801d85f KB |
114 | |
115 | #endif // __GTKFONTH__ |