]>
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
28 bool underlined
= FALSE
,
29 const wxString
& face
= wxEmptyString
,
30 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
32 (void)Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
35 wxFont(const wxNativeFontInfo
& info
);
41 bool underlined
= FALSE
,
42 const wxString
& face
= wxEmptyString
,
43 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
45 // FIXME: I added the ! to make it compile;
46 // is this right? - JACS
48 bool Create(const wxString
& fontname
,
49 wxFontEncoding fontenc
= wxFONTENCODING_DEFAULT
);
51 // DELETEME: no longer seems to be implemented.
52 // bool Create(const wxNativeFontInfo& fontinfo);
56 // implement base class pure virtuals
57 virtual int GetPointSize() const;
58 virtual int GetFamily() const;
59 virtual int GetStyle() const;
60 virtual int GetWeight() const;
61 virtual bool GetUnderlined() const;
62 virtual wxString
GetFaceName() const;
63 virtual wxFontEncoding
GetEncoding() const;
64 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
66 virtual bool IsFixedWidth() const;
68 virtual void SetPointSize(int pointSize
);
69 virtual void SetFamily(int family
);
70 virtual void SetStyle(int style
);
71 virtual void SetWeight(int weight
);
72 virtual bool SetFaceName(const wxString
& faceName
);
73 virtual void SetUnderlined(bool underlined
);
74 virtual void SetEncoding(wxFontEncoding encoding
);
76 virtual void SetNoAntiAliasing( bool no
= TRUE
);
77 virtual bool GetNoAntiAliasing() const ;
83 // Find an existing, or create a new, XFontStruct
84 // based on this wxFont and the given scale. Append the
85 // font to list in the private data for future reference.
87 // TODO This is a fairly basic implementation, that doesn't
88 // allow for different facenames, and also doesn't do a mapping
89 // between 'standard' facenames (e.g. Arial, Helvetica, Times Roman etc.)
90 // and the fonts that are available on a particular system.
91 // Maybe we need to scan the user's machine to build up a profile
92 // of the fonts and a mapping file.
94 // Return font struct, and optionally the Motif font list
95 wxXFont
*GetInternalFont(double scale
= 1.0,
96 WXDisplay
* display
= NULL
) const;
98 // Helper function for convenient access of the above.
99 WXFontStructPtr
GetFontStruct(double scale
= 1.0,
100 WXDisplay
* display
= NULL
) const;
104 virtual void DoSetNativeFontInfo( const wxNativeFontInfo
& info
);
109 DECLARE_DYNAMIC_CLASS(wxFont
)