1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: font-related helper functions
4 // Author: Vadim Zeitlin
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // General note: this header is private to wxWindows and is not supposed to be
13 // included by user code. The functions declared here are implemented in
14 // msw/fontutil.cpp for Windows, unix/fontutil.cpp for GTK/Motif &c.
16 #ifndef _WX_FONTUTIL_H_
17 #define _WX_FONTUTIL_H_
20 #pragma interface "fontutil.h"
23 // ----------------------------------------------------------------------------
25 // ----------------------------------------------------------------------------
27 #include "wx/font.h" // for wxFont and wxFontEncoding
29 #if defined(__WXMSW__)
31 #include "wx/msw/winundef.h"
34 // ----------------------------------------------------------------------------
36 // ----------------------------------------------------------------------------
38 // wxNativeFontInfo is platform-specific font representation: this struct
39 // should be considered as opaque font description only used by the native
40 // functions, the user code can only get the objects of this type from
41 // somewhere and pass it somewhere else (possibly save them somewhere using
42 // ToString() and restore them using FromString())
43 struct WXDLLEXPORT wxNativeFontInfo
45 #if defined(__WXGTK__)
47 #elif defined(__WXMSW__)
49 #else // other platforms
51 // This is a generic implementation that should work on all ports
52 // without specific support by the port.
60 wxFontEncoding encoding
;
63 // it is important to be able to serialize wxNativeFontInfo objects to be
64 // able to store them (in config file, for example)
65 bool FromString(const wxString
& s
);
66 wxString
ToString() const;
69 // ----------------------------------------------------------------------------
70 // font-related functions (common)
71 // ----------------------------------------------------------------------------
73 // translate a wxFontEncoding into native encoding parameter (defined above),
74 // returning TRUE if an (exact) macth could be found, FALSE otherwise (without
75 // attempting any substitutions)
76 extern bool wxGetNativeFontEncoding(wxFontEncoding encoding
,
77 wxNativeEncodingInfo
*info
);
79 // test for the existence of the font described by this facename/encoding,
80 // return TRUE if such font(s) exist, FALSE otherwise
81 extern bool wxTestFontEncoding(const wxNativeEncodingInfo
& info
);
83 // ----------------------------------------------------------------------------
84 // font-related functions (X and GTK)
85 // ----------------------------------------------------------------------------
88 #include "wx/unix/fontutil.h"
91 // ----------------------------------------------------------------------------
92 // font-related functions (MGL)
93 // ----------------------------------------------------------------------------
96 #include "wx/mgl/fontutil.h"
99 #endif // _WX_FONTUTIL_H_