+ if ( encid.ToLong(&enc) )
+ {
+ // old format, intepret as encoding -- but after minimal checks
+ if ( enc < 0 || enc >= wxFONTENCODING_MAX )
+ return false;
+
+ encoding = (wxFontEncoding)enc;
+ }
+ else // not a number, interpret as an encoding name
+ {
+#if wxUSE_FONTMAP
+ encoding = wxFontMapper::GetEncodingFromName(encid);
+ if ( encoding == wxFONTENCODING_MAX )
+#endif // wxUSE_FONTMAP
+ {
+ // failed to parse the name (or couldn't even try...)
+ return false;
+ }
+ }