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