X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dda88f5eee7ae13a328f92996847f90caed2e5e9..015e69f36dfbc469eef59456f973d0567e865d70:/samples/font/font.cpp diff --git a/samples/font/font.cpp b/samples/font/font.cpp index 7948599d42..00719a113f 100644 --- a/samples/font/font.cpp +++ b/samples/font/font.cpp @@ -262,10 +262,10 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) class MyEncodingEnumerator : public wxFontEnumerator { public: - MyEncodingEnumerator() + MyEncodingEnumerator() { m_n = 0; } - const wxString& GetText() const + const wxString& GetText() const { return m_text; } protected: @@ -299,10 +299,10 @@ void MyFrame::OnEnumerateEncodings(wxCommandEvent& WXUNUSED(event)) class MyFontEnumerator : public wxFontEnumerator { public: - bool GotAny() const + bool GotAny() const { return !m_facenames.IsEmpty(); } - const wxArrayString& GetFacenames() const + const wxArrayString& GetFacenames() const { return m_facenames; } protected: @@ -391,15 +391,15 @@ void MyFrame::OnEnumerateFamiliesForEncoding(wxCommandEvent& WXUNUSED(event)) static const wxString encodingNames[] = { - "West European (Latin 1)", - "Central European (Latin 2)", - "Cyrillic (Latin 5)", - "Greek (Latin 7)", - "West European new (Latin 0)", + "Western European (ISO-8859-1)", + "Central European (ISO-8859-2)", + "Cyrillic (ISO-8859-5)", + "Greek (ISO-8859-7)", + "Western European with Euro (ISO-8859-15)", "KOI8-R", - "Windows Latin 2", - "Windows Cyrillic", - "Windows Latin 1", + "Windows Central European (CP 1250)", + "Windows Cyrillic (CP 1251)", + "Windows Western European (CP 1252)", }; int n = wxGetSingleChoiceIndex("Choose an encoding", "Font demo", @@ -557,14 +557,15 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event)) m_textctrl->LoadFile(filename); - if (!wxTheFontMapper->IsEncodingAvailable(fontenc)) + if ( fontenc == wxFONTENCODING_UTF8 || + !wxTheFontMapper->IsEncodingAvailable(fontenc) ) { // try to find some similar encoding: wxFontEncoding encAlt; if ( wxTheFontMapper->GetAltForEncoding(fontenc, &encAlt) ) { wxEncodingConverter conv; - + if (conv.Init(fontenc, encAlt)) { fontenc = encAlt;