]>
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_NEW_FONT_HANDLING 1
17 #define wxMOTIF_USE_RENDER_TABLE 1
19 #define wxMOTIF_NEW_FONT_HANDLING 0
20 #define wxMOTIF_USE_RENDER_TABLE 0
26 class WXDLLIMPEXP_CORE wxFont
: public wxFontBase
36 bool underlined
= false,
37 const wxString
& face
= wxEmptyString
,
38 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
)
40 (void)Create(size
, family
, style
, weight
, underlined
, face
, encoding
);
43 wxFont(const wxNativeFontInfo
& info
);
49 bool underlined
= false,
50 const wxString
& face
= wxEmptyString
,
51 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
);
54 bool Create(const wxString
& fontname
,
55 wxFontEncoding fontenc
= wxFONTENCODING_DEFAULT
);
56 bool Create(const wxNativeFontInfo
& fontinfo
);
60 // implement base class pure virtuals
61 virtual int GetPointSize() const;
62 virtual int GetFamily() const;
63 virtual int GetStyle() const;
64 virtual int GetWeight() const;
65 virtual bool GetUnderlined() const;
66 virtual wxString
GetFaceName() const;
67 virtual wxFontEncoding
GetEncoding() const;
68 virtual const wxNativeFontInfo
*GetNativeFontInfo() const;
70 virtual void SetPointSize(int pointSize
);
71 virtual void SetFamily(int family
);
72 virtual void SetStyle(int style
);
73 virtual void SetWeight(int weight
);
74 virtual void SetFaceName(const wxString
& faceName
);
75 virtual void SetUnderlined(bool underlined
);
76 virtual void SetEncoding(wxFontEncoding encoding
);
80 // Find an existing, or create a new, XFontStruct
81 // based on this wxFont and the given scale. Append the
82 // font to list in the private data for future reference.
84 // TODO This is a fairly basic implementation, that doesn't
85 // allow for different facenames, and also doesn't do a mapping
86 // between 'standard' facenames (e.g. Arial, Helvetica, Times Roman etc.)
87 // and the fonts that are available on a particular system.
88 // Maybe we need to scan the user's machine to build up a profile
89 // of the fonts and a mapping file.
91 // Return font struct, and optionally the Motif font list
92 wxXFont
*GetInternalFont(double scale
= 1.0,
93 WXDisplay
* display
= NULL
) const;
95 // These two are helper functions for convenient access of the above.
96 #if wxMOTIF_NEW_FONT_HANDLING
97 WXFontSet
GetFontSet(double scale
, WXDisplay
* display
= NULL
) const;
98 #else // if !wxMOTIF_NEW_FONT_HANDLING
99 WXFontStructPtr
GetFontStruct(double scale
= 1.0,
100 WXDisplay
* display
= NULL
) const;
101 #endif // wxMOTIF_NEW_FONT_HANDLING
102 #if wxMOTIF_USE_RENDER_TABLE
103 WXRenderTable
GetRenderTable(WXDisplay
* display
) const;
104 #else // if !wxMOTIF_USE_RENDER_TABLE
105 WXFontList
GetFontList(double scale
= 1.0,
106 WXDisplay
* display
= NULL
) const;
107 #endif // wxMOTIF_USE_RENDER_TABLE
108 // returns either a XmFontList or XmRenderTable, depending
110 WXFontType
GetFontType(WXDisplay
* display
) const;
111 // like the function above but does a copy for XmFontList
112 WXFontType
GetFontTypeC(WXDisplay
* display
) const;
113 static WXString
GetFontTag();
115 virtual void DoSetNativeFontInfo( const wxNativeFontInfo
& info
);
120 DECLARE_DYNAMIC_CLASS(wxFont
)