]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/x11/font.h
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
);
52 bool underlined
= false,
53 const wxString
& face
= wxEmptyString
,
54 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
56 wxFont(const wxNativeFontInfo
& info
);
58 // FIXME: I added the ! to make it compile;
59 // is this right? - JACS
61 bool Create(const wxString
& fontname
,
62 wxFontEncoding fontenc
= wxFONTENCODING_DEFAULT
);
64 // DELETEME: no longer seems to be implemented.
65 // bool Create(const wxNativeFontInfo& fontinfo);
69 // implement base class pure virtuals
70 virtual int GetPointSize() const;
71 virtual wxFontFamily
GetFamily() const;
72 virtual wxFontStyle
GetStyle() const;
73 virtual wxFontWeight
GetWeight() const;
74 virtual bool GetUnderlined() const;
75 virtual wxString
GetFaceName() const;
76 virtual wxFontEncoding
GetEncoding() const;
77 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
79 virtual bool IsFixedWidth() const;
81 virtual void SetPointSize(int pointSize
);
82 virtual void SetFamily(wxFontFamily family
);
83 virtual void SetStyle(wxFontStyle style
);
84 virtual void SetWeight(wxFontWeight weight
);
85 virtual bool SetFaceName(const wxString
& faceName
);
86 virtual void SetUnderlined(bool underlined
);
87 virtual void SetEncoding(wxFontEncoding encoding
);
89 WXDECLARE_COMPAT_SETTERS
91 virtual void SetNoAntiAliasing( bool no
= TRUE
);
92 virtual bool GetNoAntiAliasing() const ;
98 // Find an existing, or create a new, XFontStruct
99 // based on this wxFont and the given scale. Append the
100 // font to list in the private data for future reference.
102 // TODO This is a fairly basic implementation, that doesn't
103 // allow for different facenames, and also doesn't do a mapping
104 // between 'standard' facenames (e.g. Arial, Helvetica, Times Roman etc.)
105 // and the fonts that are available on a particular system.
106 // Maybe we need to scan the user's machine to build up a profile
107 // of the fonts and a mapping file.
109 // Return font struct, and optionally the Motif font list
110 wxXFont
*GetInternalFont(double scale
= 1.0,
111 WXDisplay
* display
= NULL
) const;
113 // Helper function for convenient access of the above.
114 WXFontStructPtr
GetFontStruct(double scale
= 1.0,
115 WXDisplay
* display
= NULL
) const;
119 virtual wxGDIRefData
*CreateGDIRefData() const;
120 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
122 virtual void DoSetNativeFontInfo( const wxNativeFontInfo
& info
);
127 DECLARE_DYNAMIC_CLASS(wxFont
)