]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/gtk/font.h |
c801d85f KB |
3 | // Purpose: |
4 | // Author: Robert Roebling | |
58614078 | 5 | // Id: $Id$ |
371a5b4e | 6 | // Copyright: (c) 1998 Robert Roebling |
65571936 | 7 | // Licence: wxWindows licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
0416c418 PC |
10 | #ifndef _WX_GTK_FONT_H_ |
11 | #define _WX_GTK_FONT_H_ | |
c801d85f | 12 | |
0c5d3e1c | 13 | // ---------------------------------------------------------------------------- |
c801d85f | 14 | // wxFont |
0c5d3e1c | 15 | // ---------------------------------------------------------------------------- |
c801d85f | 16 | |
20123d49 | 17 | class WXDLLIMPEXP_CORE wxFont : public wxFontBase |
c801d85f | 18 | { |
358fc25c | 19 | public: |
f8855e47 | 20 | wxFont() { } |
409d5a58 | 21 | |
b960795e VZ |
22 | wxFont(const wxFontInfo& info); |
23 | ||
34be948f | 24 | wxFont(const wxString& nativeFontInfoString) |
7826e2dd | 25 | { |
34be948f | 26 | Create(nativeFontInfoString); |
7826e2dd VZ |
27 | } |
28 | ||
29 | wxFont(const wxNativeFontInfo& info); | |
0c5d3e1c | 30 | |
0c14b6c3 | 31 | #if FUTURE_WXWIN_COMPATIBILITY_3_0 |
0c5d3e1c VZ |
32 | wxFont(int size, |
33 | int family, | |
34 | int style, | |
35 | int weight, | |
dabbc6a5 | 36 | bool underlined = false, |
0c5d3e1c VZ |
37 | const wxString& face = wxEmptyString, |
38 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT) | |
39 | { | |
0c14b6c3 FM |
40 | (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); |
41 | } | |
42 | #endif | |
43 | ||
44 | wxFont(int size, | |
45 | wxFontFamily family, | |
46 | wxFontStyle style, | |
47 | wxFontWeight weight, | |
48 | bool underlined = false, | |
49 | const wxString& face = wxEmptyString, | |
50 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT) | |
51 | { | |
52 | Create(size, family, style, weight, underlined, face, encoding); | |
0c5d3e1c VZ |
53 | } |
54 | ||
b5791cc7 FM |
55 | wxFont(const wxSize& pixelSize, |
56 | wxFontFamily family, | |
57 | wxFontStyle style, | |
58 | wxFontWeight weight, | |
59 | bool underlined = false, | |
60 | const wxString& face = wxEmptyString, | |
61 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT) | |
62 | { | |
63 | Create(10, family, style, weight, underlined, face, encoding); | |
64 | SetPixelSize(pixelSize); | |
65 | } | |
03647350 | 66 | |
0c5d3e1c | 67 | bool Create(int size, |
0c14b6c3 FM |
68 | wxFontFamily family, |
69 | wxFontStyle style, | |
70 | wxFontWeight weight, | |
dabbc6a5 | 71 | bool underlined = false, |
0c5d3e1c | 72 | const wxString& face = wxEmptyString, |
7826e2dd | 73 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT); |
30764ab5 | 74 | |
7826e2dd | 75 | // wxGTK-specific |
409d5a58 | 76 | bool Create(const wxString& fontname); |
0c5d3e1c | 77 | |
d3c7fc99 | 78 | virtual ~wxFont(); |
0c5d3e1c VZ |
79 | |
80 | // implement base class pure virtuals | |
81 | virtual int GetPointSize() const; | |
0c14b6c3 FM |
82 | virtual wxFontStyle GetStyle() const; |
83 | virtual wxFontWeight GetWeight() const; | |
0c5d3e1c VZ |
84 | virtual wxString GetFaceName() const; |
85 | virtual bool GetUnderlined() const; | |
c7a49742 | 86 | virtual bool GetStrikethrough() const; |
0c5d3e1c | 87 | virtual wxFontEncoding GetEncoding() const; |
3bf5a59b | 88 | virtual const wxNativeFontInfo *GetNativeFontInfo() const; |
53f6aab7 | 89 | virtual bool IsFixedWidth() const; |
0c5d3e1c VZ |
90 | |
91 | virtual void SetPointSize( int pointSize ); | |
0c14b6c3 FM |
92 | virtual void SetFamily(wxFontFamily family); |
93 | virtual void SetStyle(wxFontStyle style); | |
94 | virtual void SetWeight(wxFontWeight weight); | |
85ab460e | 95 | virtual bool SetFaceName( const wxString& faceName ); |
0c5d3e1c | 96 | virtual void SetUnderlined( bool underlined ); |
c7a49742 | 97 | virtual void SetStrikethrough(bool strikethrough); |
0c5d3e1c VZ |
98 | virtual void SetEncoding(wxFontEncoding encoding); |
99 | ||
f76c0758 | 100 | wxDECLARE_COMMON_FONT_METHODS(); |
0c14b6c3 | 101 | |
99f8cf22 | 102 | // Set Pango attributes in the specified layout. Currently only |
c7e99122 PC |
103 | // underlined and strike-through attributes are handled by this function. |
104 | // | |
c7e99122 PC |
105 | // If neither of them is specified, returns false, otherwise sets up the |
106 | // attributes and returns true. | |
99f8cf22 | 107 | bool GTKSetPangoAttrs(PangoLayout* layout) const; |
c7e99122 | 108 | |
0c5d3e1c | 109 | // implementation from now on |
0c5d3e1c VZ |
110 | void Unshare(); |
111 | ||
0c5d3e1c VZ |
112 | // no data :-) |
113 | ||
114 | protected: | |
9045ad9d VZ |
115 | virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info ); |
116 | ||
8f884a0d VZ |
117 | virtual wxGDIRefData* CreateGDIRefData() const; |
118 | virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const; | |
fd7a7443 | 119 | |
59b7da02 VZ |
120 | virtual wxFontFamily DoGetFamily() const; |
121 | ||
0c5d3e1c | 122 | private: |
95dc31e0 PC |
123 | void Init(); |
124 | ||
0c5d3e1c | 125 | DECLARE_DYNAMIC_CLASS(wxFont) |
c801d85f KB |
126 | }; |
127 | ||
0416c418 | 128 | #endif // _WX_GTK_FONT_H_ |