1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk1/font.h
4 // Author: Robert Roebling
5 // Copyright: (c) 1998 Robert Roebling
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
14 // ----------------------------------------------------------------------------
16 // ----------------------------------------------------------------------------
18 class WXDLLIMPEXP_FWD_CORE wxDC
;
19 class WXDLLIMPEXP_FWD_CORE wxPaintDC
;
20 class WXDLLIMPEXP_FWD_CORE wxWindow
;
22 class WXDLLIMPEXP_FWD_CORE wxFont
;
24 // ----------------------------------------------------------------------------
26 // ----------------------------------------------------------------------------
28 class WXDLLIMPEXP_CORE wxFont
: public wxFontBase
34 wxFont(const wxFontInfo
& info
)
36 Create(info
.GetPointSize(),
44 if ( info
.IsUsingSizeInPixels() )
45 SetPixelSize(info
.GetPixelSize());
48 wxFont(const wxString
& fontname
)
53 wxFont(const wxNativeFontInfo
& info
);
55 #if FUTURE_WXWIN_COMPATIBILITY_3_0
60 bool underlined
= false,
61 const wxString
& face
= wxEmptyString
,
62 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
64 (void)Create(size
, (wxFontFamily
)family
, (wxFontStyle
)style
, (wxFontWeight
)weight
, underlined
, face
, encoding
);
72 bool underlined
= false,
73 const wxString
& face
= wxEmptyString
,
74 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
76 Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
79 wxFont(const wxSize
& pixelSize
,
83 bool underlined
= false,
84 const wxString
& face
= wxEmptyString
,
85 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
87 Create(10, family
, style
, weight
, underlined
, face
, encoding
);
88 SetPixelSize(pixelSize
);
95 bool underlined
= false,
96 const wxString
& face
= wxEmptyString
,
97 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
101 bool Create(const wxString
& fontname
);
105 // implement base class pure virtuals
106 virtual int GetPointSize() const;
107 virtual wxFontStyle
GetStyle() const;
108 virtual wxFontWeight
GetWeight() const;
109 virtual wxString
GetFaceName() const;
110 virtual bool GetUnderlined() const;
111 virtual wxFontEncoding
GetEncoding() const;
112 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
113 virtual bool IsFixedWidth() const;
115 virtual void SetPointSize( int pointSize
);
116 virtual void SetFamily(wxFontFamily family
);
117 virtual void SetStyle(wxFontStyle style
);
118 virtual void SetWeight(wxFontWeight weight
);
119 virtual bool SetFaceName( const wxString
& faceName
);
120 virtual void SetUnderlined( bool underlined
);
121 virtual void SetEncoding(wxFontEncoding encoding
);
123 wxDECLARE_COMMON_FONT_METHODS();
125 // implementation from now on
128 GdkFont
* GetInternalFont(float scale
= 1.0) const;
131 virtual wxGDIRefData
*CreateGDIRefData() const;
132 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
134 virtual void DoSetNativeFontInfo( const wxNativeFontInfo
& info
);
135 virtual wxFontFamily
DoGetFamily() const;
138 DECLARE_DYNAMIC_CLASS(wxFont
)
141 #endif // __GTKFONTH__