]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/font.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFont class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
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
);
53 bool Create(const wxString
& fontname
,
54 wxFontEncoding fontenc
= wxFONTENCODING_DEFAULT
);
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 void SetPointSize(int pointSize
);
73 virtual void SetFamily(int family
);
74 virtual void SetStyle(int style
);
75 virtual void SetWeight(int weight
);
76 virtual void SetFaceName(const wxString
& faceName
);
77 virtual void SetUnderlined(bool underlined
);
78 virtual void SetEncoding(wxFontEncoding encoding
);
82 // Find an existing, or create a new, XFontStruct
83 // based on this wxFont and the given scale. Append the
84 // font to list in the private data for future reference.
86 // TODO This is a fairly basic implementation, that doesn't
87 // allow for different facenames, and also doesn't do a mapping
88 // between 'standard' facenames (e.g. Arial, Helvetica, Times Roman etc.)
89 // and the fonts that are available on a particular system.
90 // Maybe we need to scan the user's machine to build up a profile
91 // of the fonts and a mapping file.
93 // Return font struct, and optionally the Motif font list
94 wxXFont
*GetInternalFont(double scale
= 1.0,
95 WXDisplay
* display
= NULL
) const;
97 // These two are helper functions for convenient access of the above.
98 WXFontStructPtr
GetFontStruct(double scale
= 1.0,
99 WXDisplay
* display
= NULL
) const;
100 WXFontList
GetFontList(double scale
= 1.0,
101 WXDisplay
* display
= NULL
) const;
103 WXRenderTable
GetRenderTable(WXDisplay
* display
) const;
105 // returns either a XmFontList or XmRendition, depending
107 WXFontType
GetFontType(WXDisplay
* display
) const;
108 // like the function above but does a copy for XmFontList
109 WXFontType
GetFontTypeC(WXDisplay
* display
) const;
110 static WXString
GetFontTag();
112 virtual void DoSetNativeFontInfo( const wxNativeFontInfo
& info
);
114 // common part of all ctors
117 // VZ: IMHO, we don't need it at all...
118 bool RealizeResource() { return true; }
122 DECLARE_DYNAMIC_CLASS(wxFont
)