- wxFONTENCODING_ISO8859_1,
- wxFONTENCODING_ISO8859_2,
- wxFONTENCODING_ISO8859_5,
- wxFONTENCODING_ISO8859_7,
- wxFONTENCODING_ISO8859_15,
- wxFONTENCODING_KOI8,
- wxFONTENCODING_KOI8_U,
- wxFONTENCODING_CP1250,
- wxFONTENCODING_CP1251,
- wxFONTENCODING_CP1252,
- };
-
- static const wxString encodingNames[] =
+ DoEnumerateFamilies(false, enc);
+ }
+}
+
+void MyFrame::OnSetNativeDesc(wxCommandEvent& WXUNUSED(event))
+{
+ wxString fontInfo = wxGetTextFromUser
+ (
+ wxT("Enter native font string"),
+ wxT("Input font description"),
+ m_canvas->GetTextFont().GetNativeFontInfoDesc(),
+ this
+ );
+ if ( fontInfo.empty() )
+ return; // user clicked "Cancel" - do nothing
+
+ wxFont font;
+ font.SetNativeFontInfo(fontInfo);
+ if ( !font.IsOk() )
+ {
+ wxLogError(wxT("Font info string \"%s\" is invalid."),
+ fontInfo.c_str());
+ return;
+ }
+
+ DoChangeFont(font);
+}
+
+void MyFrame::OnSetNativeUserDesc(wxCommandEvent& WXUNUSED(event))
+{
+ wxString fontdesc = GetCanvas()->GetTextFont().GetNativeFontInfoUserDesc();
+ wxString fontUserInfo = wxGetTextFromUser(
+ wxT("Here you can edit current font description"),
+ wxT("Input font description"), fontdesc,
+ this);
+ if (fontUserInfo.IsEmpty())
+ return; // user clicked "Cancel" - do nothing
+
+ wxFont font;
+ if (font.SetNativeFontInfoUserDesc(fontUserInfo))