]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/font.h
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_GTK_FONT_H_
11 #define _WX_GTK_FONT_H_
13 // ----------------------------------------------------------------------------
15 // ----------------------------------------------------------------------------
17 class WXDLLIMPEXP_CORE wxFont
: public wxFontBase
23 wxFont(const wxString
& nativeFontInfoString
)
25 Create(nativeFontInfoString
);
28 wxFont(const wxNativeFontInfo
& info
);
30 #if FUTURE_WXWIN_COMPATIBILITY_3_0
35 bool underlined
= false,
36 const wxString
& face
= wxEmptyString
,
37 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
39 (void)Create(size
, (wxFontFamily
)family
, (wxFontStyle
)style
, (wxFontWeight
)weight
, underlined
, face
, encoding
);
47 bool underlined
= false,
48 const wxString
& face
= wxEmptyString
,
49 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
51 Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
54 wxFont(const wxSize
& pixelSize
,
58 bool underlined
= false,
59 const wxString
& face
= wxEmptyString
,
60 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
62 Create(10, family
, style
, weight
, underlined
, face
, encoding
);
63 SetPixelSize(pixelSize
);
68 int flags
= wxFONTFLAG_DEFAULT
,
69 const wxString
& face
= wxEmptyString
,
70 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
76 bool underlined
= false,
77 const wxString
& face
= wxEmptyString
,
78 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
81 bool Create(const wxString
& fontname
);
85 // implement base class pure virtuals
86 virtual int GetPointSize() const;
87 virtual wxFontStyle
GetStyle() const;
88 virtual wxFontWeight
GetWeight() const;
89 virtual wxString
GetFaceName() const;
90 virtual bool GetUnderlined() const;
91 virtual bool GetStrikethrough() const;
92 virtual wxFontEncoding
GetEncoding() const;
93 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
94 virtual bool IsFixedWidth() const;
96 virtual void SetPointSize( int pointSize
);
97 virtual void SetFamily(wxFontFamily family
);
98 virtual void SetStyle(wxFontStyle style
);
99 virtual void SetWeight(wxFontWeight weight
);
100 virtual bool SetFaceName( const wxString
& faceName
);
101 virtual void SetUnderlined( bool underlined
);
102 virtual void SetStrikethrough(bool strikethrough
);
103 virtual void SetEncoding(wxFontEncoding encoding
);
105 wxDECLARE_COMMON_FONT_METHODS();
107 // Set Pango attributes in the specified layout. Currently only
108 // underlined and strike-through attributes are handled by this function.
110 // If neither of them is specified, returns false, otherwise sets up the
111 // attributes and returns true.
112 bool GTKSetPangoAttrs(PangoLayout
* layout
) const;
114 // implementation from now on
120 virtual void DoSetNativeFontInfo( const wxNativeFontInfo
& info
);
122 virtual wxGDIRefData
* CreateGDIRefData() const;
123 virtual wxGDIRefData
* CloneGDIRefData(const wxGDIRefData
* data
) const;
125 virtual wxFontFamily
DoGetFamily() const;
130 DECLARE_DYNAMIC_CLASS(wxFont
)
133 #endif // _WX_GTK_FONT_H_