]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/fontutil.h
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 // for our purposes here, GDK and X are identical
30 #if defined(__WXGTK__) || defined(__X__)
31 #define _WX_X_FONTLIKE
34 // ----------------------------------------------------------------------------
36 // ----------------------------------------------------------------------------
38 // This private structure specifies all the parameters needed to create a font
39 // with the given encoding on this platform.
41 // Under X, it contains the last 2 elements of the font specifications
42 // (registry and encoding).
44 // Under Windows, it contains a number which is one of predefined CHARSET_XXX
47 // Under all platforms it also contains a facename string which should be
48 // used, if not empty, to create fonts in this encoding (this is the only way
49 // to create a font of non-standard encoding (like KOI8) under Windows - the
50 // facename specifies the encoding then)
52 struct wxNativeEncodingInfo
54 wxString facename
; // may be empty meaning "any"
56 #if defined(__WXMSW__)
58 #elif defined(_WX_X_FONTLIKE)
62 #error "Unsupported toolkit"
65 // this struct is saved in config by wxFontMapper, so it should know to
66 // serialise itself (implemented in platform-specific code)
67 bool FromString(const wxString
& s
);
68 wxString
ToString() const;
71 // ----------------------------------------------------------------------------
72 // font-related functions (common)
73 // ----------------------------------------------------------------------------
75 // translate a wxFontEncoding into native encoding parameter (defined above),
76 // returning TRUE if an (exact) macth could be found, FALSE otherwise (without
77 // attempting any substitutions)
78 extern bool wxGetNativeFontEncoding(wxFontEncoding encoding
,
79 wxNativeEncodingInfo
*info
);
81 // test for the existence of the font described by this facename/encoding,
82 // return TRUE if such font(s) exist, FALSE otherwise
83 extern bool wxTestFontEncoding(const wxNativeEncodingInfo
& info
);
85 // ----------------------------------------------------------------------------
86 // font-related functions (X and GTK)
87 // ----------------------------------------------------------------------------
90 #include "wx/unix/fontutil.h"
93 #endif // _WX_FONTUTIL_H_