]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/font.h
Big color update with the newest information
[wxWidgets.git] / include / wx / gtk / font.h
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(void);
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, 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 );
61 bool Ok() const;
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 );
76
77 // implementation
78
79 GdkFont* GetInternalFont(float scale = 1.0) const;
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
113 extern wxFontNameDirectory *wxTheFontNameDirectory;
114
115 #endif // __GTKFONTH__