]>
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 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "font.h"
22 class wxFont
: public wxFontBase
27 wxFont(const wxFont
& font
) { Init(); Ref(font
); }
33 bool underlined
= FALSE
,
34 const wxString
& face
= wxEmptyString
,
35 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
39 (void)Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
42 wxFont(const wxNativeFontInfo
& info
);
48 bool underlined
= FALSE
,
49 const wxString
& face
= wxEmptyString
,
50 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
52 // FIXME: I added the ! to make it compile;
53 // is this right? - JACS
55 bool Create(const wxString
& fontname
,
56 wxFontEncoding fontenc
= wxFONTENCODING_DEFAULT
);
58 // DELETEME: no longer seems to be implemented.
59 // bool Create(const wxNativeFontInfo& fontinfo);
64 wxFont
& operator=(const wxFont
& font
);
66 // implement base class pure virtuals
67 virtual int GetPointSize() const;
68 virtual int GetFamily() const;
69 virtual int GetStyle() const;
70 virtual int GetWeight() const;
71 virtual bool GetUnderlined() const;
72 virtual wxString
GetFaceName() const;
73 virtual wxFontEncoding
GetEncoding() const;
74 virtual wxNativeFontInfo
*GetNativeFontInfo() const;
76 virtual bool IsFixedWidth() const;
78 virtual void SetPointSize(int pointSize
);
79 virtual void SetFamily(int family
);
80 virtual void SetStyle(int style
);
81 virtual void SetWeight(int weight
);
82 virtual void SetFaceName(const wxString
& faceName
);
83 virtual void SetUnderlined(bool underlined
);
84 virtual void SetEncoding(wxFontEncoding encoding
);
85 virtual void SetNativeFontInfo( const wxNativeFontInfo
& info
);
87 virtual void SetNoAntiAliasing( bool no
= TRUE
);
88 virtual bool GetNoAntiAliasing();
94 // Find an existing, or create a new, XFontStruct
95 // based on this wxFont and the given scale. Append the
96 // font to list in the private data for future reference.
98 // TODO This is a fairly basic implementation, that doesn't
99 // allow for different facenames, and also doesn't do a mapping
100 // between 'standard' facenames (e.g. Arial, Helvetica, Times Roman etc.)
101 // and the fonts that are available on a particular system.
102 // Maybe we need to scan the user's machine to build up a profile
103 // of the fonts and a mapping file.
105 // Return font struct, and optionally the Motif font list
106 wxXFont
*GetInternalFont(double scale
= 1.0,
107 WXDisplay
* display
= NULL
) const;
109 // Helper function for convenient access of the above.
110 WXFontStructPtr
GetFontStruct(double scale
= 1.0,
111 WXDisplay
* display
= NULL
) const;
115 // common part of all ctors
121 DECLARE_DYNAMIC_CLASS(wxFont
)