]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/x11/font.h
f05177a46dae0631029de6b817fd94dfdf5d1463
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 wxFont(const wxFontInfo
& info
)
26 Create(info
.GetPointSize(),
34 if ( info
.IsUsingSizeInPixels() )
35 SetPixelSize(info
.GetPixelSize());
38 #if FUTURE_WXWIN_COMPATIBILITY_3_0
43 bool underlined
= false,
44 const wxString
& face
= wxEmptyString
,
45 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
47 (void)Create(size
, (wxFontFamily
)family
, (wxFontStyle
)style
, (wxFontWeight
)weight
, underlined
, face
, encoding
);
55 bool underlined
= false,
56 const wxString
& face
= wxEmptyString
,
57 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
59 Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
62 wxFont(const wxSize
& pixelSize
,
66 bool underlined
= false,
67 const wxString
& face
= wxEmptyString
,
68 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
70 Create(10, family
, style
, weight
, underlined
, face
, encoding
);
71 SetPixelSize(pixelSize
);
78 bool underlined
= false,
79 const wxString
& face
= wxEmptyString
,
80 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
82 wxFont(const wxNativeFontInfo
& info
);
84 // FIXME: I added the ! to make it compile;
85 // is this right? - JACS
87 bool Create(const wxString
& fontname
,
88 wxFontEncoding fontenc
= wxFONTENCODING_DEFAULT
);
90 // DELETEME: no longer seems to be implemented.
91 // bool Create(const wxNativeFontInfo& fontinfo);
95 // implement base class pure virtuals
96 virtual int GetPointSize() const;
97 virtual wxFontStyle
GetStyle() const;
98 virtual wxFontWeight
GetWeight() const;
99 virtual bool GetUnderlined() const;
100 virtual wxString
GetFaceName() const;
101 virtual wxFontEncoding
GetEncoding() const;
102 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
104 virtual bool IsFixedWidth() const;
106 virtual void SetPointSize(int pointSize
);
107 virtual void SetFamily(wxFontFamily family
);
108 virtual void SetStyle(wxFontStyle style
);
109 virtual void SetWeight(wxFontWeight weight
);
110 virtual bool SetFaceName(const wxString
& faceName
);
111 virtual void SetUnderlined(bool underlined
);
112 virtual void SetEncoding(wxFontEncoding encoding
);
114 wxDECLARE_COMMON_FONT_METHODS();
120 // Find an existing, or create a new, XFontStruct
121 // based on this wxFont and the given scale. Append the
122 // font to list in the private data for future reference.
124 // TODO This is a fairly basic implementation, that doesn't
125 // allow for different facenames, and also doesn't do a mapping
126 // between 'standard' facenames (e.g. Arial, Helvetica, Times Roman etc.)
127 // and the fonts that are available on a particular system.
128 // Maybe we need to scan the user's machine to build up a profile
129 // of the fonts and a mapping file.
131 // Return font struct, and optionally the Motif font list
132 wxXFont
*GetInternalFont(double scale
= 1.0,
133 WXDisplay
* display
= NULL
) const;
135 // Helper function for convenient access of the above.
136 WXFontStructPtr
GetFontStruct(double scale
= 1.0,
137 WXDisplay
* display
= NULL
) const;
141 virtual wxGDIRefData
*CreateGDIRefData() const;
142 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
144 virtual void DoSetNativeFontInfo( const wxNativeFontInfo
& info
);
145 virtual wxFontFamily
DoGetFamily() const;
150 DECLARE_DYNAMIC_CLASS(wxFont
)