added GetEncodingFromName(); documented it and rearranged the methods in alphaabetical order

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26703 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-04-11 10:40:04 +00:00
parent 635f33cedd
commit 910b9fc5c0
3 changed files with 83 additions and 17 deletions

View File

@@ -706,5 +706,26 @@ wxString wxFontMapperBase::GetEncodingName(wxFontEncoding encoding)
return str;
}
/* static */
wxFontEncoding wxFontMapperBase::GetEncodingFromName(const wxString& name)
{
const size_t count = WXSIZEOF(gs_encodingNames);
for ( size_t i = 0; i < count; i++ )
{
if ( gs_encodingNames[i] == name )
{
return gs_encodings[i];
}
}
if ( name == _("default") )
{
return wxFONTENCODING_DEFAULT;
}
return wxFONTENCODING_MAX;
}
#endif // wxUSE_FONTMAP