wxFONTENCODING_ISO8859_MAX,
// Cyrillic charset soup (see http://czyborra.com/charsets/cyrillic.html)
- wxFONTENCODING_KOI8, // we don't support any of KOI8 variants
+ wxFONTENCODING_KOI8, // KOI8 Russian
+ wxFONTENCODING_KOI8_U, // KOI8 Ukrainian
wxFONTENCODING_ALTERNATIVE, // same as MS-DOS CP866
wxFONTENCODING_BULGARIAN, // used under Linux in Bulgaria
// NB: hard-coded now, but might change later (read it from config?)
static wxString GetEncodingDescription(wxFontEncoding encoding);
+ // find the encoding corresponding to the given name, inverse of
+ // GetEncodingName() and less general than CharsetToEncoding()
+ //
+ // returns wxFONTENCODING_MAX if the name is not a supported encoding
+ static wxFontEncoding GetEncodingFromName(const wxString& name);
+
// set the config object to use (may be NULL to use default)
void SetConfig(wxConfigBase *config);
// checks whether given encoding is available in given face or not.
- // If no facename is given,
+ // If no facename is given (default), return true if it's available in any
+ // facename at all.
bool IsEncodingAvailable(wxFontEncoding encoding,
const wxString& facename = wxPyEmptyString);
%newgroup
+MustHaveApp(wxFont);
+MustHaveApp(wxFont::GetDefaultEncoding);
+MustHaveApp(wxFont::SetDefaultEncoding);
+
class wxFont : public wxGDIObject {
public:
+ %pythonPrepend wxFont "if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']"
+
wxFont( int pointSize, int family, int style, int weight,
bool underline=False, const wxString& face = wxPyEmptyString,
wxFontEncoding encoding=wxFONTENCODING_DEFAULT);
}
%name(Font2) wxFont(int pointSize,
- wxFontFamily family,
- int flags = wxFONTFLAG_DEFAULT,
- const wxString& face = wxPyEmptyString,
- wxFontEncoding encoding = wxFONTENCODING_DEFAULT) {
+ wxFontFamily family,
+ int flags = wxFONTFLAG_DEFAULT,
+ const wxString& face = wxPyEmptyString,
+ wxFontEncoding encoding = wxFONTENCODING_DEFAULT) {
return wxFont::New(pointSize, family, flags, face, encoding);
}
}
%pythoncode { def __nonzero__(self): return self.Ok() }
// comparison
- bool operator == (const wxFont& font) const;
- bool operator != (const wxFont& font) const;
+ %extend {
+ bool __eq__(const wxFont* other) { return other ? (*self == *other) : False; }
+ bool __ne__(const wxFont* other) { return other ? (*self != *other) : True; }
+ }
// accessors: get the font characteristics
virtual int GetPointSize() const;
%}
+MustHaveApp(wxPyFontEnumerator);
+
%name(FontEnumerator) class wxPyFontEnumerator {
public:
%pythonAppend wxPyFontEnumerator "self._setCallbackInfo(self, FontEnumerator, 0)"