]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/x11/font.h
a7197b878b4d10c8ef6c19279425fdbf46c17d94
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFont class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
18 class WXDLLIMPEXP_CORE wxFont
: public wxFontBase
24 #if FUTURE_WXWIN_COMPATIBILITY_3_0
29 bool underlined
= false,
30 const wxString
& face
= wxEmptyString
,
31 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
33 (void)Create(size
, (wxFontFamily
)family
, (wxFontStyle
)style
, (wxFontWeight
)weight
, underlined
, face
, encoding
);
41 bool underlined
= false,
42 const wxString
& face
= wxEmptyString
,
43 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
45 Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
48 wxFont(const wxSize
& pixelSize
,
52 bool underlined
= false,
53 const wxString
& face
= wxEmptyString
,
54 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
56 Create(10, family
, style
, weight
, underlined
, face
, encoding
);
57 SetPixelSize(pixelSize
);
64 bool underlined
= false,
65 const wxString
& face
= wxEmptyString
,
66 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
68 wxFont(const wxNativeFontInfo
& info
);
70 // FIXME: I added the ! to make it compile;
71 // is this right? - JACS
73 bool Create(const wxString
& fontname
,
74 wxFontEncoding fontenc
= wxFONTENCODING_DEFAULT
);
76 // DELETEME: no longer seems to be implemented.
77 // bool Create(const wxNativeFontInfo& fontinfo);
81 // implement base class pure virtuals
82 virtual int GetPointSize() const;
83 virtual wxFontFamily
GetFamily() const;
84 virtual wxFontStyle
GetStyle() const;
85 virtual wxFontWeight
GetWeight() const;
86 virtual bool GetUnderlined() const;
87 virtual wxString
GetFaceName() const;
88 virtual wxFontEncoding
GetEncoding() const;
89 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
91 virtual bool IsFixedWidth() const;
93 virtual void SetPointSize(int pointSize
);
94 virtual void SetFamily(wxFontFamily family
);
95 virtual void SetStyle(wxFontStyle style
);
96 virtual void SetWeight(wxFontWeight weight
);
97 virtual bool SetFaceName(const wxString
& faceName
);
98 virtual void SetUnderlined(bool underlined
);
99 virtual void SetEncoding(wxFontEncoding encoding
);
101 wxDECLARE_COMMON_FONT_METHODS();
107 // Find an existing, or create a new, XFontStruct
108 // based on this wxFont and the given scale. Append the
109 // font to list in the private data for future reference.
111 // TODO This is a fairly basic implementation, that doesn't
112 // allow for different facenames, and also doesn't do a mapping
113 // between 'standard' facenames (e.g. Arial, Helvetica, Times Roman etc.)
114 // and the fonts that are available on a particular system.
115 // Maybe we need to scan the user's machine to build up a profile
116 // of the fonts and a mapping file.
118 // Return font struct, and optionally the Motif font list
119 wxXFont
*GetInternalFont(double scale
= 1.0,
120 WXDisplay
* display
= NULL
) const;
122 // Helper function for convenient access of the above.
123 WXFontStructPtr
GetFontStruct(double scale
= 1.0,
124 WXDisplay
* display
= NULL
) const;
128 virtual wxGDIRefData
*CreateGDIRefData() const;
129 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
131 virtual void DoSetNativeFontInfo( const wxNativeFontInfo
& info
);
136 DECLARE_DYNAMIC_CLASS(wxFont
)