]>
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
22 wxFont(const wxFontInfo
& info
);
24 wxFont(const wxString
& nativeFontInfoString
)
26 Create(nativeFontInfoString
);
29 wxFont(const wxNativeFontInfo
& info
);
31 #if FUTURE_WXWIN_COMPATIBILITY_3_0
36 bool underlined
= false,
37 const wxString
& face
= wxEmptyString
,
38 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
40 (void)Create(size
, (wxFontFamily
)family
, (wxFontStyle
)style
, (wxFontWeight
)weight
, underlined
, face
, encoding
);
48 bool underlined
= false,
49 const wxString
& face
= wxEmptyString
,
50 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
52 Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
55 wxFont(const wxSize
& pixelSize
,
59 bool underlined
= false,
60 const wxString
& face
= wxEmptyString
,
61 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
63 Create(10, family
, style
, weight
, underlined
, face
, encoding
);
64 SetPixelSize(pixelSize
);
71 bool underlined
= false,
72 const wxString
& face
= wxEmptyString
,
73 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
76 bool Create(const wxString
& fontname
);
80 // implement base class pure virtuals
81 virtual int GetPointSize() const;
82 virtual wxFontStyle
GetStyle() const;
83 virtual wxFontWeight
GetWeight() const;
84 virtual wxString
GetFaceName() const;
85 virtual bool GetUnderlined() const;
86 virtual bool GetStrikethrough() const;
87 virtual wxFontEncoding
GetEncoding() const;
88 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
89 virtual bool IsFixedWidth() const;
91 virtual void SetPointSize( int pointSize
);
92 virtual void SetFamily(wxFontFamily family
);
93 virtual void SetStyle(wxFontStyle style
);
94 virtual void SetWeight(wxFontWeight weight
);
95 virtual bool SetFaceName( const wxString
& faceName
);
96 virtual void SetUnderlined( bool underlined
);
97 virtual void SetStrikethrough(bool strikethrough
);
98 virtual void SetEncoding(wxFontEncoding encoding
);
100 wxDECLARE_COMMON_FONT_METHODS();
102 // Set Pango attributes in the specified layout. Currently only
103 // underlined and strike-through attributes are handled by this function.
105 // If neither of them is specified, returns false, otherwise sets up the
106 // attributes and returns true.
107 bool GTKSetPangoAttrs(PangoLayout
* layout
) const;
109 // implementation from now on
115 virtual void DoSetNativeFontInfo( const wxNativeFontInfo
& info
);
117 virtual wxGDIRefData
* CreateGDIRefData() const;
118 virtual wxGDIRefData
* CloneGDIRefData(const wxGDIRefData
* data
) const;
120 virtual wxFontFamily
DoGetFamily() const;
125 DECLARE_DYNAMIC_CLASS(wxFont
)
128 #endif // _WX_GTK_FONT_H_