fix creating wxFont with non-ascii name, closes #16671
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78141 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -58,9 +58,7 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
public: // used by the GTK callback only
|
public: // used by the GTK callback only
|
||||||
|
void SetNativeFontInfo(const char* gtkdescription);
|
||||||
void SetNativeFontInfo(const char *gtkdescription)
|
|
||||||
{ m_selectedFont.SetNativeFontInfo(wxString::FromAscii(gtkdescription)); }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Common part of both ctors.
|
// Common part of both ctors.
|
||||||
|
@@ -301,8 +301,10 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* widget,
|
|||||||
if (!font_name)
|
if (!font_name)
|
||||||
attr.font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
|
attr.font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
|
||||||
else
|
else
|
||||||
attr.font = wxFont(wxString::FromAscii(font_name));
|
{
|
||||||
g_free (font_name);
|
attr.font = wxFont(wxString::FromUTF8(font_name));
|
||||||
|
g_free(font_name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tlw)
|
if (tlw)
|
||||||
|
@@ -106,4 +106,8 @@ void wxFontButton::UpdateFont()
|
|||||||
gtk_font_button_set_font_name(GTK_FONT_BUTTON(m_widget), wxGTK_CONV(fontname));
|
gtk_font_button_set_font_name(GTK_FONT_BUTTON(m_widget), wxGTK_CONV(fontname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxFontButton::SetNativeFontInfo(const char* gtkdescription)
|
||||||
|
{
|
||||||
|
m_selectedFont.SetNativeFontInfo(wxString::FromUTF8(gtkdescription));
|
||||||
|
}
|
||||||
#endif // wxUSE_FONTPICKERCTRL
|
#endif // wxUSE_FONTPICKERCTRL
|
||||||
|
Reference in New Issue
Block a user