]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/font.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/font.h
3 // Purpose: wxFont class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if __WXMOTIF20__ && !__WXLESSTIF__
16 #define wxMOTIF_USE_RENDER_TABLE 1
18 #define wxMOTIF_USE_RENDER_TABLE 0
20 #define wxMOTIF_NEW_FONT_HANDLING wxMOTIF_USE_RENDER_TABLE
25 class WXDLLIMPEXP_CORE wxFont
: public wxFontBase
31 wxFont(const wxNativeFontInfo
& info
);
33 #if FUTURE_WXWIN_COMPATIBILITY_3_0
38 bool underlined
= false,
39 const wxString
& face
= wxEmptyString
,
40 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
42 (void)Create(size
, (wxFontFamily
)family
, (wxFontStyle
)style
, (wxFontWeight
)weight
, underlined
, face
, encoding
);
50 bool underlined
= false,
51 const wxString
& face
= wxEmptyString
,
52 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
54 Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
61 bool underlined
= false,
62 const wxString
& face
= wxEmptyString
,
63 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
66 bool Create(const wxString
& fontname
,
67 wxFontEncoding fontenc
= wxFONTENCODING_DEFAULT
);
68 bool Create(const wxNativeFontInfo
& fontinfo
);
72 // implement base class pure virtuals
73 virtual int GetPointSize() const;
74 virtual wxFontFamily
GetFamily() const;
75 virtual wxFontStyle
GetStyle() const;
76 virtual wxFontWeight
GetWeight() const;
77 virtual bool GetUnderlined() const;
78 virtual wxString
GetFaceName() const;
79 virtual wxFontEncoding
GetEncoding() const;
80 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
82 virtual void SetPointSize(int pointSize
);
83 virtual void SetFamily(wxFontFamily family
);
84 virtual void SetStyle(wxFontStyle style
);
85 virtual void SetWeight(wxFontWeight weight
);
86 virtual bool SetFaceName(const wxString
& faceName
);
87 virtual void SetUnderlined(bool underlined
);
88 virtual void SetEncoding(wxFontEncoding encoding
);
90 WXDECLARE_COMPAT_SETTERS
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 // These two are helper functions for convenient access of the above.
110 #if wxMOTIF_USE_RENDER_TABLE
111 WXFontSet
GetFontSet(double scale
, WXDisplay
* display
= NULL
) const;
112 WXRenderTable
GetRenderTable(WXDisplay
* display
) const;
113 #else // if !wxMOTIF_USE_RENDER_TABLE
114 WXFontStructPtr
GetFontStruct(double scale
= 1.0,
115 WXDisplay
* display
= NULL
) const;
116 WXFontList
GetFontList(double scale
= 1.0,
117 WXDisplay
* display
= NULL
) const;
118 #endif // !wxMOTIF_USE_RENDER_TABLE
119 // returns either a XmFontList or XmRenderTable, depending
121 WXFontType
GetFontType(WXDisplay
* display
) const;
122 // like the function above but does a copy for XmFontList
123 WXFontType
GetFontTypeC(WXDisplay
* display
) const;
124 static WXString
GetFontTag();
127 virtual wxGDIRefData
*CreateGDIRefData() const;
128 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
130 virtual void DoSetNativeFontInfo( const wxNativeFontInfo
& info
);
135 DECLARE_DYNAMIC_CLASS(wxFont
)
138 #endif // _WX_FONT_H_