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 // ----------------------------------------------------------------------------
31 // ----------------------------------------------------------------------------
33 // wxNativeFontInfo is platform-specific font representation: this struct
34 // should be considered as opaque font description only used by the native
35 // functions, the user code can only get the objects of this type from
36 // somewhere and pass it somewhere else (possibly save them somewhere using
37 // ToString() and restore them using FromString())
38 struct WXDLLEXPORT wxNativeFontInfo
40 #if defined(__WXGTK__)
42 #else // other platforms
44 // This is a generic implementation that should work on all ports
45 // without specific support by the port.
53 wxFontEncoding encoding
;
56 // it is important to be able to serialize wxNativeFontInfo objects to be
57 // able to store them (in config file, for example)
58 bool FromString(const wxString
& s
);
59 wxString
ToString() const;
62 // ----------------------------------------------------------------------------
63 // font-related functions (common)
64 // ----------------------------------------------------------------------------
66 // translate a wxFontEncoding into native encoding parameter (defined above),
67 // returning TRUE if an (exact) macth could be found, FALSE otherwise (without
68 // attempting any substitutions)
69 extern bool wxGetNativeFontEncoding(wxFontEncoding encoding
,
70 wxNativeEncodingInfo
*info
);
72 // test for the existence of the font described by this facename/encoding,
73 // return TRUE if such font(s) exist, FALSE otherwise
74 extern bool wxTestFontEncoding(const wxNativeEncodingInfo
& info
);
76 // ----------------------------------------------------------------------------
77 // font-related functions (X and GTK)
78 // ----------------------------------------------------------------------------
81 #include "wx/unix/fontutil.h"
84 #endif // _WX_FONTUTIL_H_