- for ( unsigned i = (equiv[0] == encoding) ? 1 : 0; i < equiv.GetCount(); i++ )
- if ( TestAltEncoding(configEntry, equiv[i], info) )
- return TRUE;
+ size_t count = equiv.GetCount();
+ if ( count )
+ {
+ for ( size_t i = (equiv[0] == encoding) ? 1 : 0; i < count; i++ )
+ {
+ if ( TestAltEncoding(configEntry, equiv[i], info) )
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+bool wxFontMapper::GetAltForEncoding(wxFontEncoding encoding,
+ wxFontEncoding *alt_encoding,
+ const wxString& facename,
+ bool interactive)
+{
+ wxNativeEncodingInfo info;
+ bool r = GetAltForEncoding(encoding, &info, facename, interactive);
+ *alt_encoding = info.encoding;
+ return r;
+}
+
+bool wxFontMapper::IsEncodingAvailable(wxFontEncoding encoding,
+ const wxString& facename)
+{
+ wxNativeEncodingInfo info;
+
+ if (wxGetNativeFontEncoding(encoding, &info))
+ {
+ info.facename = facename;
+ return wxTestFontEncoding(info);
+ }