]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/font.h
9f7cb9b92b54b715e84001daec2a3c751f3e9c17
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
18 #include "wx/object.h"
19 #include "wx/string.h"
21 #include "wx/gdiobj.h"
23 // ----------------------------------------------------------------------------
24 // conditional compilation
25 // ----------------------------------------------------------------------------
27 #define wxUSE_FONTNAMEDIRECTORY 0
29 // ----------------------------------------------------------------------------
31 // ----------------------------------------------------------------------------
39 #if wxUSE_FONTNAMEDIRECTORY
40 class wxFontNameDirectory
;
43 // ----------------------------------------------------------------------------
45 // ----------------------------------------------------------------------------
47 extern const wxChar
* wxEmptyString
;
49 #if wxUSE_FONTNAMEDIRECTORY
50 extern wxFontNameDirectory
*wxTheFontNameDirectory
;
53 // ----------------------------------------------------------------------------
55 // ----------------------------------------------------------------------------
57 class wxFont
: public wxFontBase
62 wxFont(const wxFont
& font
) { Init(); Ref(font
); }
65 wxFont
& operator=(const wxFont
& font
);
71 bool underlined
= FALSE
,
72 const wxString
& face
= wxEmptyString
,
73 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
77 (void)Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
84 bool underlined
= FALSE
,
85 const wxString
& face
= wxEmptyString
,
86 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
90 // implement base class pure virtuals
91 virtual int GetPointSize() const;
92 virtual int GetFamily() const;
93 virtual int GetStyle() const;
94 virtual int GetWeight() const;
95 virtual wxString
GetFaceName() const;
96 virtual bool GetUnderlined() const;
97 virtual wxFontEncoding
GetEncoding() const;
99 virtual void SetPointSize( int pointSize
);
100 virtual void SetFamily( int family
);
101 virtual void SetStyle( int style
);
102 virtual void SetWeight( int weight
);
103 virtual void SetFaceName( const wxString
& faceName
);
104 virtual void SetUnderlined( bool underlined
);
105 virtual void SetEncoding(wxFontEncoding encoding
);
107 // implementation from now on
108 wxFont( GdkFont
* font
, char *xFontName
);
111 GdkFont
* GetInternalFont(float scale
= 1.0) const;
116 // common part of all ctors
120 DECLARE_DYNAMIC_CLASS(wxFont
)
123 #if wxUSE_FONTNAMEDIRECTORY
125 // ----------------------------------------------------------------------------
127 // ----------------------------------------------------------------------------
129 class wxFontNameDirectory
: public wxObject
131 DECLARE_DYNAMIC_CLASS(wxFontNameDirectory
)
134 wxFontNameDirectory();
135 ~wxFontNameDirectory();
138 void Initialize(int fontid
, int family
, const char *name
);
140 int FindOrCreateFontId(const char *name
, int family
);
141 char* GetAFMName(int fontid
, int weight
, int style
);
142 int GetFamily(int fontid
);
143 int GetFontId(const char *name
);
144 char* GetFontName(int fontid
);
146 char* GetPostScriptName(int fontid
, int weight
, int style
);
147 char* GetScreenName(int fontid
, int weight
, int style
);
149 class wxHashTable
*table
;
153 #endif // wxUSE_FONTNAMEDIRECTORY
155 #endif // __GTKFONTH__